Number of divs with same class using jquery
<p>How can I find the number of divs with a specific class name using jquery</p>

<p>like here I would like to get the result as 2 for class name "failedtest". and I also want to access them through the id of outer div (1285766787423container)</p>

<pre><code>&lt;div id="1285766787423container" class="container"&gt;
    &lt;div class="row"&gt;
        &lt;div class="cell1"&gt;
        &lt;/div&gt;
        &lt;div class="failedtest"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div style="display: none;" class="row"&gt;
        &lt;div class="cell1"&gt;
        &lt;/div&gt;
        &lt;div class="failedtest"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div style="display: none;" class="row"&gt;
        &lt;div class="cell1"&gt;
        &lt;/div&gt;
        &lt;div class="cell2"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div style="display: none;" class="row"&gt;
        &lt;div class="cell1"&gt;
        &lt;/div&gt;
        &lt;div class="cell2"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

    &lt;div id="1285766787423container" class="container"&gt;
    &lt;div class="row"&gt;
        &lt;div class="cell1"&gt;
        &lt;/div&gt;
        &lt;div class="failedtest"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div style="display: none;" class="row"&gt;
        &lt;div class="cell1"&gt;
        &lt;/div&gt;
        &lt;div class="failedtest"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div style="display: none;" class="row"&gt;
        &lt;div class="cell1"&gt;
        &lt;/div&gt;
        &lt;div class="cell2"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div style="display: none;" class="row"&gt;
        &lt;div class="cell1"&gt;
        &lt;/div&gt;
        &lt;div class="cell2"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>
