Hi in my script there is a jquery tab. The script is working, tab-content is changing but when clicked a tab I want to change class property of the li of active tab as class="current"
How can I do it? thanks.

<ul class="nav-content">
<li class="current first-li"><a href="#tabs-1">tab 1</a></li>
<li><a href="#tabs-2">tab 2</a></li>
<li><a href="#tabs-3">tab 3</a></li>
</ul>


<script>
$(document).ready(function() {



$(".tab_content").hide();


$("ul.nav-content current:first").addClass("active").show();
$(".tab_content:first").show();



//On Click Event
$("ul.nav-content li").click(function() {


$("ul.nav-content current").removeClass("active");
$(this).addClass("active");
$(".tab_content").hide();


var activeTab = $(this).find("a").attr("href");
$(activeTab).show();
return false;
});


});
</script>
Member Avatar for stbuchok

Use the select event of the tab control. In that event you can set it's class by using addClass.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.