html - CSS Change button image on click -


I have two HTML image buttons (both are gray), and whenever a user clicks on any button, I have to change the color of the color to the color image of the image (I have 2 colorful images) and the second button is grayed out then the user can know the active button.

How do I get it into CSS?

  $ (".button") .click (function () {$ ('.button') .removeClass ('Active'); $ (this) .addClass ('active');}); & Lt; Input type = "button" square = "button" id = "button1" value = "button1" & gt; & Lt; Input type = "button" square = "button" id = "button2" value = "button2" & gt;   

Then with CSS you set the color you can have as many buttons as you want. See Below below to see how it works.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -