JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box">
</div>
CSS
.box
{
cursor: pointer;
height: 100px;
width: 100px;
background: red;
}
JavaScript
$(document).ready(function(){
$(".box").click(function(){
if ($(".box").css("background-color") == "red")
{
$(".box").html("Success!");
}
});
});