how can I search in a table for a row with a specifik innerHTML value?
<table>
<tr><td>test</td><td>100</td></tr>
<tr><td>test</td><td>200</td></tr>
<tr><td>test</td><td>300</td></tr>
</table>
I need the index for the row (tr) where the second td is 200
here the index has to give 1
$('table tr'). something??
EDIT:
and I also need a version that select the index before a give value is bigger (asc) than 200 (i开发者_开发技巧f it exists)
$("TABLE TR").each(function() {
if ($("TD", this).eq(1).html()== "200") {
// Your logic here
return false; // break out of .each() loop
}
});
var ind = $('table tr:contains(200)').index();
精彩评论