I am using bootstrap 3. I want to change button color when I click on button.I mean button should be in different color when it is selected. How can I do this using css?
HTML--
Button1 Button2
css--
.active{ background:red; } button.btn:active{ background:red; }
jQuery--
jQuery("#my_styles .btn").click(function(){ jQuery("#my_styles .btn").removeClass('active'); jQuery(this).toggleClass('active');
});
view the live demo on jsfiddle