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 id="test" class="btn">click me<div>'));
});

$("body").on("click", "#test", function(){
   alert("worked!"); 
});