开发者

Get number of elements within a number of the same elements

I hope I can word this okay.

I have multiple divs all called '.collapse-conten' and within each of these I have a table called '.collapseTable'. What I would like to do is check the number of rows within each table.

I have 开发者_StackOverflowthis code right now...

var num = $(".collapse-content tr").size(); alert(num);

This obviously returns all rows in the page and the number of rows per div named '.collapse-content'

Can someone please help with this.

Many thanks, Cj


$(".collapse-content").each(function(){
    console.log($(this).find('.collapseTable tr').length);
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜