How can I count the number of divs with a slide class in each set. In the example below, the first group "element" will be with three, and the second group will have two. I am trying to use .length, but it adds all the “slides” of the div.
<div class="item">
<div class="foo"></div>
<div class="bar">
<div class="slide"></div>
<div class="slide"></div>
<div class="slide"></div>
</div>
</div>
<div id="item">
<div class="foo"></div>
<div class="bar">
<div class="slide"></div>
<div class="slide"></div>
</div>
</div>
source
share