jQuery: Run commands only if selected element has class
<p>I have a tab system set up that uses the following structure to automatically detect new tabs:</p>

<pre><code>&lt;a href="#div1id"&gt;Show div 1&lt;/a&gt;
&lt;div id="div1id"&gt;Div1&lt;/div&gt;
</code></pre>

<p>The thing is, I need to disable the ability to reload a tab by clicking the tab that is already showing. I have tried using .hasClass() and .is() to detect if the clicked tab was already had '.active' applied to it, but with no luck.</p>

<p>Here is my current code for the animation and changes:</p>

<pre><code>$(document).ready(function(){
 $("#tabs li").click(function() {
  $("#tabs li").removeClass('active');
  $(this).addClass("active");
  $(".content").hide();
  var selected_tab = $(this).find("a").attr("href");
  $(selected_tab).fadeIn();
 });
});
</code></pre>
