开发者

Retrieve tr from table

开发者 https://www.devze.com 2022-12-19 06:16 出处:网络
How can i retrieve all the tr with class=\"ccc\" from a table with id开发者_开发知识库\"=iii\"?var rows = $(\'table#iii tr.ccc\');

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

精彩评论

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

关注公众号