JSFiddle - React, Tailwind, and code Playground
by Joe Pigott
HTML
<div></div>
<label for='div'></label>
CSS
div {
width: 15px;
height: 15px;
background: #4a4a4a;
cursor: pointer;
}
.active {
background: #96f226
}
JavaScript
$('div').mouseenter(function(){
$(this).css('background','#656565');
});
$('div').mouseleave(function(){
$(this).css('background','#4a4a4a');
});
$('div').click(function(){
$(this).toggleClass('active');
});