【发布时间】:2011-05-29 17:47:19
【问题描述】:
我有 3 个具有相同类名 table-sort 的表。我想通过.each() 访问这些表并计算tbody 中的tr。
是$("this tbody tr").length吗?
$('.table-sort').each(function(index) {
var rowCount = $("this tbody tr").length; //not work , Could you please correct this?
var rowCount1 = $(this).find('tbody > tr').length; //this is working fine
alert(rowCount + '-' + rowCount1);
})
【问题讨论】: