title: jQuery: Get number of elements that have a certain class
body: <p>How do I get the number of elements that have the particular class <code>.added</code> when the element with the class <code>.header</code> is clicked?</p>
  
  <pre><code>&lt;ul class="main"&gt; 
      &lt;li class="header"&gt;Header&lt;/li&gt;
      &lt;li class="added"&gt;One&lt;/li&gt;
      &lt;li&gt;Two&lt;/li&gt;
      &lt;li class="added"&gt;Three&lt;/li&gt;
      &lt;li&gt;Four&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>So in this case, when I click the element with the class <code>.header</code> I would want to retrieve the number 2.</p>