JSFiddle - React, Tailwind, and code Playground

HTML

<!-- JavaScript element.classList Object remove() method Example -->
<!-- blog.kevinchisholm.com -->

<div id="foo" class="bar">click me to remove the class: "bar"</div>

CSS

#foo:hover{
    cursor:pointer;
}

.bar{
    background-color: yellow;
    padding: 10px;
    font: bold 22px Arial;
    color: red;
}

JavaScript

var foo = document.getElementById('foo');

foo.addEventListener('click',function(){
    this.classList.remove("bar");
    this.innerHTML = 'i no longer have the class "bar"';
},false);