JSFiddle - React, Tailwind, and code Playground
HTML
<span class="button">Click me!</span>
CSS
.button {
display: inline-block;
padding: 1em;
color: white;
background-color: gray;
}
.button.active {
background-color: black;
}
JavaScript
$('.button').click(function() {
$(this).toggleClass('active', 'desactive');
});