i have following code
$("#v-nav-exp-liv li a").click(function(){
//code for action related #v-nav-exp-liv li a
//code for action related .content-nav li
$(".content-nav li").removeClass("tab");
$(".content-nav li.zik-liv").addClass("tab");
return false;
});
the html is as follow
<ul class="content-nav">
<li class="zik-liv"><a href="index.php?p=explore">Zikrs</a></li>
<li class="ppl-liv"><a href="index.php?p=explore&t=ppl">People</a></li>
</ul>
<ul class="part v-nav" id="v-nav-exp-liv">
<li><a href="#" type="zikr_explore" sort_by="all">All</a></li>
<li><a href="#" type="zikr_explore" sort_by="most_shared">Most Shared</a></li>
</ul>
the code related to “#v-nav-exp-liv li a” is very much working, i don’t know why addclass is not working….
your code and
addClassare working just fine : see example – example is a direct paste of your code with a visual highlight added to show the.tabclass activatingfor every link inside the second list, it’s only targeting the first link in the first list, that never changes, perhaps you’re trying to do something different than that?