JSFiddle - React, Tailwind, and code Playground

HTML

<button type="button" name="stybut" id="stybut">HELLO</button>

CSS

#stybut { background : #00FF00; border: 2px double red }
#stybut.active { background : red; border: 2px double green }

JavaScript

document.getElementById('stybut').addEventListener('click', function() {
  this.classList.toggle('active');
});