Use jQuery to count the number of div's inside a div
<p>I have the following output:</p>

<pre><code>&lt;section class="group"&gt;
  &lt;div class="header"&gt;Header 1&lt;/div&gt;

  &lt;div class="item"&gt;item1&lt;/div&gt;
  &lt;div class="item"&gt;item2&lt;/div&gt;
  &lt;div class="item"&gt;item3&lt;/div&gt;

&lt;/section&gt;

&lt;section class="group"&gt;
  &lt;div class="header"&gt;Header 2&lt;/div&gt;

  &lt;div class="item"&gt;item1&lt;/div&gt;
  &lt;div class="item"&gt;item2&lt;/div&gt;
  &lt;div class="item"&gt;item3&lt;/div&gt;
  &lt;div class="item"&gt;item4&lt;/div&gt;
  &lt;div class="item"&gt;item5&lt;/div&gt;

&lt;/section&gt;
</code></pre>

<p>I want to use jQuery to tell me how many <code>.item</code> elements are in each <code>&lt;section&gt;</code>. Currently trying this, but it doesn't give me the correct number:</p>

<pre><code>$('section.group').each(
  function() {
    alert($(this).length);
  }
);
</code></pre>
