JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
Hi, this is test
<div class="one">Hi, I am old</div>
<br>
</div>
<br>
<button class="add">Add</button>
CSS
.one{
color: red;
background-color: grey;
}
JavaScript
$(".add").click(function(){
$(".parent").append("<div class='one'> I am new </div>");
alert("your content is added");
});
$('.one').trigger('click');
$('body').delegate(".one", "click", function(e){
// do you other works here
alert("hi, I can here you: "+$(this).text());
});