JSFiddle - React, Tailwind, and code Playground
HTML
<p>Click 3 squares...</p>
<span>$</span>
<br>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
CSS
div {
width: 60px;
height: 60px;
margin: 5px;
padding: 20px;
float: left;
background: green;
cursor:pointer;
color: #fff;
text-align: center;
}
p {
color: red;
}
JavaScript
$("div").one( "click", function() {
$(this).css({
background: "red",
cursor: "auto",
});
$(this).append( "0" );
$( "span" ).append( "0" );
});