ToggleClass() is not toggling classes [SOLVED]
Hello. I am trying to change all three tab class to remove the extraneous "active" from the class name of each tab, then prepend the "active" class to a certain tab. Here is the code I tried to write, but it doesn't take the "active" off the tab_01 anchor:
-
$(".tab_01 active").toggleClass("tab_01");
$(".tab_02 active").toggleClass("tab_02");
$(".tab_03 active").toggleClass("tab_03");
// re-assign class - this will be dynamic
$(".tab_01").toggleClass("tab_01 active");
Here is the XHTML code:
-
<div class="tabs">
<a class="tab_01 active"> </a>
<a class="tab_02"> </a>
<a class="tab_03"> </a>
</div>
thank you![/code]