title: Find closest div that has a certain class
body: <p>Let's say that I have some HTML like this:</p>
  
  <pre><code>&lt;div&gt;
      &lt;div class="required another_class"&gt;
          &lt;div class="some_class"&gt;
              &lt;input type="checkbox" name="some_check" value="" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How do I find the parent div of the checkbox that has the class <code>required</code>? As you can see above, the div has two classes <code>required</code> and <code>another_class</code>. Therefore something like this:</p>
  
  <pre><code>$(':checkbox').closest('div[class=required]');
  </code></pre>
  
  <p>Will not work. I thought I could do something like:</p>
  
  <pre><code>$(':checkbox').closest('div').hasClass('required');
  </code></pre>
  
  <p>But that doesn't work either.</p>