JSFiddle - React, Tailwind, and code Playground

by deepak sisodiya

HTML

<p id="p1">This is a paragraph.</p>

JavaScript

// jquery hover event
// hover : combination of the mouseenter() and mouseleave() methods.

var alert = function (str) {
    var st = document.createTextNode(str);
    var p = document.createElement('p');
    p.appendChild(st);
    document.querySelector('body').appendChild(p);
}

$("#p1").hover(function () {
    alert("You entered p1!");
},
function () {
    alert("Bye! You now leave p1!");
});