JSFiddle - React, Tailwind, and code Playground

HTML

<h2></h2>
<button>generate new element</button>

JavaScript

$("button").click(function() {
    $("h2").html("<p class='test'>click me</p>")
});


$(".test").live('click', function() {
    alert('you clicked me!');
});