JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" value="click Me" id="test" class="blue red" />

CSS

.red {
    background-color:red;
}
.blue {
    background-color:blue;
}

JavaScript

$("#test").click(function () {
    $(this).toggleClass("red");
});