Skip to content Skip to sidebar Skip to footer

How To Change (and Keep) The Color Of A Button On Click

I would like to toggle the color of a button upon a user click. Right now, when the user clicks the button momentarily changes color but then immediately changes back to the 1st co

Solution 1:

Place the return false in the called function

functionTVbuttonPressed(id){       
document.getElementById(id).style.backgroundColor  = 0xFFFF00;

returnfalse;  --this will prevent the change of color while refreshing.

}

it will work

Post a Comment for "How To Change (and Keep) The Color Of A Button On Click"