Reputation: 2215
In my pen I am using jQuery to toggle on and off css classes when buttons are clicked.
$('.btn-icon').on('click',function(){
$(this).toggleClass('colorMe');
)};
How would I go about removing the class from a button that has been pressed class when a new button is pressed?
Just to reiterate when I click on get past the menu button and click on a sub menu button it turns white. I want to make that button turn black when another is pressed. http://codepen.io/anon/pen/BjrPxe?editors=1111
Upvotes: 0
Views: 52
Reputation: 15941
$(".colorMe").removeClass("colorMe");
Run before your existing toggleClass line.
Upvotes: 1