JSFiddle - React, Tailwind, and code Playground
HTML
<div id="div1" onclick="divclick(this)"></div>
CSS
#div1{
width:100px;
height: 100px;
background-color: #000;
}
JavaScript
function divclick(sender){
$(sender).attr('background-color','green');
}