JSFiddle - React, Tailwind, and code Playground
by Daniel Hall
HTML
<br />
<button id="button">
click me
</button>
JavaScript
var button = document
.getElementById("button");
button.addEventListener("click", replaceIt);
function replaceIt() {
document.getElementById("button")
.style.backgroundColor = "blue";
// Change the text color.
document.getElementById("button")
}