jQuery event "change" not working when checking out if a selector has a class, need help choosing proper event
<p>So I'm working with a jQuery sliding tabs code, and I need other tabs to take on a class when a different tab is selected. This is what I've written:</p>

<pre><code>$(document).change(function() {
  if ($('#tab_5').hasClass('st_tab_active')) {
      $('#tab_4').addClass('st_tab_active2');
  }
  else
    {$('#tab_4').removeClass('st_tab_active2');};
} );
</code></pre>

<p>I'm using <code>change</code> but it's not the proper event I can tell, and I'm not sure which is. When clicking on prev and next buttons, <code>#tab_5</code> takes on the class <code>st_tab_active</code> when it is selected. I need <code>#tab_4</code> to take on <code>st_tab_active2</code> when this occurs. What is the proper event I should be using?</p>
