JSFiddle - React, Tailwind, and code Playground

HTML

<button id="pre_loaded">click me</button>

JavaScript

/* without delegation */

$("button").on("click", function(){
    alert( this.id );
})

var b = $("<button id='created_dinamically'>click me</button>");
$("body").append( b );