How to find number of
    inside each div

后端 未结 4 1483
广开言路
广开言路 2021-01-24 03:49

I have a large file of this form [similar div\'s throughout]. I want to be able to select a div, find the number of ul\'s in it and traverse through ea

4条回答
  •  孤街浪徒
    2021-01-24 04:22

    $('.experiment').each(function() {
        var cnt = $(this).children('ul').length;
        $(this).find('.experiment-number').text(cnt);
    });
    

提交回复
热议问题