JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test" onClick="javascript:change()">qwerty</div>

CSS

#test {
    color: blue;
}

#test:hover {color:green!important;}

JavaScript

function change() {

document.getElementById("test").style.color="#cc0000";
    
};