How do you see if $(this) has a certain class?
<p>I have:</p>

<pre><code>$('th a').click(function() {
   var $th = $(this).closest('th');
   $th.toggleClass('selected');
</code></pre>

<p>How do I say:</p>

<pre><code>if ($th('.selected')) {
    alert('selected');
} else {
    alert('not selected');
}
</code></pre>
