JSFiddle - React, Tailwind, and code Playground

by Graham Fairweather

HTML

<button id="a">My Button</div>

CSS

#a {
    background-color: yellow;
}

JavaScript

document.getElementById("a").addEventListener("click", function onClick() {
    this.removeEventListener("click", onClick);
    
    this.style.backgroundColor = "#004f40";  
}, false);