JSFiddle - React, Tailwind, and code Playground
HTML
<div></div>
CSS
div {
background:red;
height:100px;
width:150px;
}
JavaScript
$('div').toggle(
function(){
$(this).css('background-color', 'blue');
},
function(){
$(this).css('background-color', 'red');
});