[SOLVED] How can I modify button?

[SOLVED] How can I modify button?
0

#1

I am building the tic tac toe game

Basically I am unable to figure out how to modify the button in the modal, when it is clicked ( for example to change color when it is clicked or remove outline)


#2

There are two options I can think of.

  1. Use the CSS pseudoselector :active on the button’s selector.
#my-button:active {
   //css
}
  1. Use the click event in JavaScript:
var button = document.getElementById("my-button");
button.addEventListener("click", function(event) {
  var _this = event.target;
  // change style on _this
});

jQuery is, of course, makes this much easier.