JSFiddle - React, Tailwind, and code Playground

JavaScript

jQuery('<div id="test1" style="background-color:red;">Test test test</div>').appendTo(document.body);
jQuery("#test1").bind("click.test", function(){$(this).css({backgroundColor:'green'});});
jQuery("#test1").clone(true).attr("id", "test2").appendTo(document.body);
jQuery("#test1").trigger("click.test");
jQuery("#test2").trigger("click.test");