title: using jQuery to determine if children of a div have a css class
body: <p>On one of my web pages I'm currently checking whether a css class <em>isn't</em> being used, like so:</p>
  
  <pre><code>if (!$('*').hasClass("my-special-class")) {
  </code></pre>
  
  <p>The above works but it's checking every element on the page.  In fact, I only need to check within a particular <code>div</code> (id = 'mydiv') and its child elements, but am not quite sure what sort of selector to use, and would welcome a suggestion?</p>