我有3个具有相同类名的表table-sort.我想访问那些表.each()并计算tr内部tbody.
是$("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);
})
Run Code Online (Sandbox Code Playgroud)