How to change the class property of & lt; li & gt; in the jQuery tab widget

advertisements

In my script there is a jQuery tab widget. When I click a tab I want to change the class property of the li of the active tab to current.

How can I do it?

HTML:

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

jQuery:

$("ul.nav-content li").click(function() {
    // ??
})


$("ul.nav-content li").click(function() {
     //you'll probably want to remove all 'current' classes first
     $(".current").removeClass("current")
     $(this).addClass("current")
})