JSFiddle - React, Tailwind, and code Playground
HTML
<div class="a">
This is the A div
<div class="b">
This is the B div
</div>
</div>
CSS
.a {
background-color: red;
width: 100px;
height: 100px;
position: relative;
}
.b {
background-color: blue;
width: 100px;
height: 100px;
position:absolute;
top: 50px;
left: 50px;
}
JavaScript
$('.a').hover(function() {
alert('mouseenter');
}, function() {
alert('mouseleave');
});