Reputation: 2295
Here is my fiddle http://jsfiddle.net/codejedi/JJpNz/ . I am trying to change tab color and class when clicked. So far i am able to remove the active class from the button i am migrating from but not able to add active class to the one i am clicking.
Here is my code
$('#headerTab').click(function (e) {
$('ul.nav-tabs li.active').removeClass('active')
$(this).parent('li').addClass('active')
})
Upvotes: 0
Views: 165
Reputation: 3572
$('ul.nav-tabs li a').click(function (e) {
$('ul.nav-tabs li.active').removeClass('active');
$(this).parent('li').addClass('active');
})
Upvotes: 1