jQuery: If all children have same class
<p>How do I check if all children, or all selectors, have same class?</p>

<p>The class is unknown... </p>

<pre><code>&lt;script&gt;
    $(document).ready(function() {
        var symbols = $("div:first-child").attr("class");

        if ($("div").hasClass(symbols).length == 3) {
            console.log("same");
        };
    });
&lt;/script&gt;
&lt;div class="john"&gt;&lt;/div&gt;
&lt;div class="john"&gt;&lt;/div&gt;
&lt;div class="john"&gt;&lt;/div&gt;
</code></pre>

<p>This doesn't work... :-/</p>
