How to find whether a class is applied?
<p>I want to check if a "particular" class is applied to a span inside a div or not.So i tried</p>

<pre><code>$('#div').click(function() {
     console.log($(this).find('.myImgClass').length);  // returns 0-if not found
                                                      // 1 if found
}
</code></pre>

<h2>HTMl</h2>

<pre><code>&lt;div&gt;
 &lt;span class="myImgClass"&gt;&lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>Is this the right way to do it ?</p>
