title: How to select first parent DIV using jQuery?
body: <pre><code>var classes = $(this).attr('class').split(' '); // this gets the current element classes
  
  var classes = $(this).parent().attr('class').split(' '); // this gets the parent classes.
  </code></pre>
  
  <p>The parent in the above situation is an ankor.</p>
  
  <p>If I wanted to get the first parent DIV of $(this) what would the code look like?</p>
  
  <pre><code>var classes = $(this).div:parent().attr('class').split(' '); // just a quick try.
  </code></pre>
  
  <p><em>*</em> Basically I want to get the classes of the first parent DIV of $(this).</p>
  
  <p>thx</p>