JSFiddle - React, Tailwind, and code Playground
by emepyc
HTML
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<button id="1" class="clickme">click me:1</button>
<button id="2" class="clickme">click me:2</button>
<div id="div1"></div>
</body>
</html>
JavaScript
$(".clickme").click(clicked);
function clicked() {
alert(this.id);
var parent = this;
$("#div1").html("<button id=\"clickme3\">Who created me?</button>");
$("#clickme3").click(function(){$(parent).trigger('click')});
}