JSFiddle - React, Tailwind, and code Playground
HTML
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
CSS
div {
width:100px;
height:100px;
margin:5px;
float:left;
background-color:#F0F;
}
JavaScript
$('div').on({
mouseover: function () {
$this = $(this);
if (!$this.hasClass("current"))return;
$this.css('background-color', '#F00');
},
mouseout:function(){
if($(this).hasClass("current"))return;
$(this).addClass("current")
}
})