tags:

views:

39

answers:

3

How can i retrieve all the tr with class="ccc" from a table with id"=iii"?

+2  A: 
var rows = $('table#iii tr.ccc');
Tom
+2  A: 
$("table#iii tr.ccc")
Kezzer
A: 

Using the direct child selector will be faster:

$("table#iii>tbody>tr.ccc");

Also, there is no point in table#iiii. An id selector is faster than an element selector, so the following will suffice:

$("#iii>tbody>tr.ccc");

In fact, if you can add an ID to your row (e.g. MyRow) then you can bypass this alltogether, cutting down considerably the amount of DOM traversing you have to do

$("#MyRow");
James Wiseman
Adding the same ID to each row would cause a W3C validation error, every ID should be unique.
asrijaal