JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent"><div>
JavaScript
var $el= $('<div class="el">');
$el.append('<div>asdf</div><div class="click">click</div>');
$el.on('click', '.click', function(e){
alert( 'it works the first time, but if you add again, it fails');
$('.parent').html( $el );
});
$('.parent').html( $el );