title: Using jQuery how do I find which row # contains an input with a value in it?
body: <p>I have a table that has multiple rows.  I am trying to return the row # that contains an input which has a value in it.  I understand what I'm doing wrong... my selector is only selecting 1 row, instead of the row # I'm in.  <a href="http://jsfiddle.net/silvajeff/4Sb8K/" rel="nofollow">http://jsfiddle.net/silvajeff/4Sb8K/</a></p>
  
  <pre><code>   &lt;table id="oustandingItems"&gt;
      &lt;tr&gt;&lt;th&gt;Category&lt;/th&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;input name="mytest" /&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;input name="mytest" value="123"/&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;input name="mytest" /&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;input name="mytest" /&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;/table&gt;
  
  
    &lt;button id="findRow"&gt;Find Row&lt;/button&gt;
    &lt;input type="text" id="myRow" /&gt;
  
  $("#findRow").click(function() {   
     var tableRow = $('#oustandingItems tr:has(td input[value!=""])').prevAll().length;  
     $("#myRow").val(tableRow);
  });
  </code></pre>