JSFiddle - React, Tailwind, and code Playground

by deepak sisodiya

HTML

<p id="p1">Enter this paragraph.</p>

JavaScript

// jquery mouseenter and mouseleave event

 $("#p1").mouseenter(function(){
    alert("You entered p1!");
 });

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

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