开发者

Retrieve tr from table

How can i retrieve all the tr with class="ccc" from a table with id开发者_开发知识库"=iii"?


var rows = $('table#iii tr.ccc');


$("table#iii tr.ccc")


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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜