JSFiddle - React, Tailwind, and code Playground

HTML

<div id="sam">
  <p>hover on me and i will alert you.</p>
</div>

JavaScript

$('#sam').hover(

function () {
  alert("hey it's sam.");
});
var sam = $("#sam");
$("<button id='btn'>haha</button>").appendTo(sam);
$("#btn").click(function(){
 alert(“haha”);
})