JSFiddle - React, Tailwind, and code Playground

by lucasprus

HTML

<p>The mouseover event triggers when the mouse pointer enters the child elements as well as the selected element.</p>
<p>The mouseenter event is only triggered when the mouse pointer enters the selected element.</p>
<div class="over" style="background-color:lightgray;padding:20px;width:250px;float:left">
    
<h3 style="background-color:white;">Mouseover event triggered: <span></span></h3>

</div>
<div class="enter" style="background-color:lightgray;padding:20px;width:250px;float:right">
    
<h3 style="background-color:white;">Mouseenter event triggered: <span></span></h3>

</div>

JavaScript

jQuery(function ($) {
    var x = 0,
        y = 0;
    $("div.over").mouseover(function () {
        $(this).find("span").text(x += 1);
    });
    $("div.enter").mouseenter(function () {
        $(this).find("span").text(y += 1);
    });
});