JSFiddle - React, Tailwind, and code Playground
HTML
<div id="sample">
</div>
CSS
#sample {
width:200px;
height:200px;
background: #aaa;
}
JavaScript
jQuery.fn.mouseIsOver = function () {
if($(this[0]).is(":hover"))
{
return true;
}
return false;
};
setInterval(function(){
var $sample = $("#sample");
if($sample.mouseIsOver()) {
$sample.css("background", "yellow");
}
else {
$sample.css("background", "");
}
}, 200);