JSFiddle - React, Tailwind, and code Playground
by Trufa
HTML
<div class="box" id="one">
</div>
<div class="box" id="two">
</div>
<div class="box" id="three
re">
</div>
CSS
.box{
outline:1px solid red;
height:60px;
width:60px;
}
.red{
background-color: red;
}
.blue{
background-color: blue;
}
JavaScript
var $a = $('.box');
$a.click(function(){
$(this).addClass('red');
});