How do I get the number of elements that have the particular class .added
when the element with the class .header
is clicked?
<ul class="main">
<li class="header">Header</li>
<li class="added">One</li>
<li>Two</li>
<li class="added">Three</li>
<li>Four</li>
</ul>
So in this case, when I click the element with the class .header
I would want to retrieve the number 2.