Reputation:
Can you please tell me how to add active class in jQuery. So that user know it is selected and unselected button?
Here is my fiddle http://jsfiddle.net/GG7ZZ/48/
$(document).ready(function(){
$("#btn").click(function(){
$("#btn").addClass('highlight')
});
});
Upvotes: 0
Views: 137
Reputation: 3669
Here you go: http://jsfiddle.net/GG7ZZ/52/
button:active {
background: yellow;
}
You don't even need javascript for this. Just add the above CSS and it'll do what you want.
Upvotes: 1