JSFiddle - React, Tailwind, and code Playground
HTML
<div id="clickme"> Click me </div>
CSS
div{ background:#00CC00; display:inline-block; margin:20px; border-radius:5px; padding:20px;cursor:pointer;}
JavaScript
$('#clickme').click(function(){
var color = $(this).css('background-color');
alert(color);
if(color == '#cc0000'){
this.css('background', '#00CC00');
}else{
this.css('background', '#CC0000');
}
})