Skip to content
Advertisement

How do I show a selected button in a row by changing CSS in an HTML site?

I have a div of buttons in line and I want the user to be able to see when they selected a button by changing the CSS and it only going back to its old state when they select another button. Is this possible?

Advertisement

Answer

Find all the buttons and add event listener to execute some javascript where you put the logic of changing the behaviour of the buttons.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement