count elements of a class within another class
<p>What is the best way to count elements of a particular class within another element?</p>

<p>I have the class of the parent element, but there are other elements with that class. So if for example I have an element that i get to like this:</p>

<pre><code>$(document).on('click', '.countButton', function(){

    var parent = $(this).parents('parentDiv');


});
</code></pre>

<p>How can I put that element into a selector to count it like this:</p>

<p><code>$('.parentDiv &gt; .childDivs').length;</code></p>

<p>Is there someway to convert an element into a selector, or something that points to that element? If that makes sense..</p>

<p>Thanks!</p>
