count number of divs for each container in jquery
<p>How can I count the number of divs with the class of "slide" in each set. In the example below the first group "item" will and up with three and the second group will have two. I've been trying to use .length but it adds all of the "slide" divs up. </p>

<pre><code>&lt;div class="item"&gt;
  &lt;div class="foo"&gt;&lt;/div&gt;
  &lt;div class="bar"&gt;
     &lt;div class="slide"&gt;&lt;/div&gt;
     &lt;div class="slide"&gt;&lt;/div&gt;
     &lt;div class="slide"&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;!-- /item --&gt;

&lt;div id="item"&gt;
  &lt;div class="foo"&gt;&lt;/div&gt;
  &lt;div class="bar"&gt;
     &lt;div class="slide"&gt;&lt;/div&gt;
     &lt;div class="slide"&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;!-- /item --&gt;
</code></pre>
