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

sonata admin - how to add ManyToOne property field in configureListfield in sonataAdmin -

wpf - ControlTemplate with changes for every class -

sql - Return Function using Cursor -