184
rated 0 times
[
189]
[
5]
/ answers: 1 / hits: 19323
/ 12 Years ago, fri, november 16, 2012, 12:00:00
I've seen some very similar questions floating around but haven't been able to find the answer I'm looking for. I've already determined a work-around but would like to know the proper way to perform the task.
What I desire is to click the button and have the active state stay persistent. The next click will toggle the state and that is desired. What I really need to know is how to address the uiButton:active state.
HTML:
<input type='button' class='uiButton' id='testbutton' value='testValue'>
CSS:
.uiButton{
background-color: red;
}
.uiButton:active{
background-color:blue;
}
Javascript/jQuery:
$('.uiButton').click(function() {
$(this).toggleClass(//active state);
});
More From » jquery