Best way to cross this segment DOM

advertisements

Is there a better way than traversing like this?:

$('#part'+rowNumber).parent().parent().next().children('input').val(manufacturer);

The DOM segment in question is:

var html = '<div class="row-fluid">';
    html += '<div class="span1"><img title="Remove part." class="pull-right remove-part" width="20px" src="http://www.view.com/public_html/images/icons/minus.png"></div>';
    html += '<div class="span1"><input type="number" value="1" class="span12"/></div>';
    html += '<div class="span5"><input id="part'+rowNumber+'" type="text" class="span12"/></div>';
    html += '<div class="span4"><input type="text" class="span12 last"/></div>';
    html += '<div class="span1"></div>';
    html += '</div>';


You can write like:

$('#part'+rowNumber).parents('.row-fluid').next().children('input').val(manufacturer);