JSFiddle - React, Tailwind, and code Playground

by jfriend00

HTML

<button id="user_button">Toggle</button><br>
<div class="hello">Hi</div>

CSS

.active {color: #F00;}

JavaScript

$('#user_button').toggle(function () {
    $(".hello").addClass("active");
}, function () {
    $(".hello").removeClass("active");
});