JSFiddle - React, Tailwind, and code Playground

by deepak sisodiya

HTML

<p>Click this paragraph.</p>

JavaScript

// on method of jquery
/* $(selector).on(event,childSelector,data,function,map)
   event:Required
   childSelector:optional
   data:optional
   function:Required
*/

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

 $("p").on("click",function(){
    alert("The paragraph was clicked.");
 });