JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box">Hover it to change background</div>
CSS
.box {
height: 200px;
width: 200px;
background: green;
transition: background 2s;
}
.background-change {
background: red;
}
JavaScript
$('.box').hover(function() {
$(this).toggleClass('background-change');
});