How to find number of
    inside each div

后端 未结 4 1481
广开言路
广开言路 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:31

    to get all the ul inside div.experiment

    var ul = $('.experiment').find('ul');
    

    and to get all li elements inside each ul found above

    ul.each(function(list) {
     var li = $(list).find('li');
    });
    

提交回复
热议问题