A
A
AnnaUniq2018-03-15 23:21:33
JavaScript
AnnaUniq, 2018-03-15 23:21:33

How to count the number of li in ul?

Good day!
There are several lists . It is
necessary to output to the console the number of li in each of the available lists, only not in total, but separately

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Decadal, 2018-03-15
@AnnaUniq

$('ul').each(function(){
console.log($(this).find('li').length);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question