JSFiddle - React, Tailwind, and code Playground
HTML
<div id="create" class="btn">Click to create an element!</div>
CSS
.btn {
width: 220px;
height: 20px;
background-color: #CCF;
text-align: center;
font-family: "Trebuchet MS";
font-size: 14px;
border-radius: 5px;
margin: 20px 30px;
cursor:pointer;
}
JavaScript
$("#create").click(function(){
$('body').append($('<div class="test btn">click me</div>'));
});
$(".test").bind("click", function(){
alert("worked!");
});