116
rated 0 times
[
119]
[
3]
/ answers: 1 / hits: 61039
/ 14 Years ago, tue, july 27, 2010, 12:00:00
I'm using jquery's .each() to iterate over a group of li's. I need a total of all the li's matched. Is the only way to create a count variable outside the .each() and increment this inside the .each()? It doesn't seem very elegant.
var count;
$('#accordion li').each(function() {
++count;
});
More From » jquery