JSFiddle - React, Tailwind, and code Playground
HTML
<div id="receveur">
</div>
JavaScript
$.ajax({
url: "/echo/html/",
data: {
html:"<div><scri" + "pt language='javascript' type='text/javascript'>function hello() {confirm('Hello');}<\/scr" + "ipt><h2>This is a title</h2></div>"},
dataType: "html",
type: "POST",
success: function(html) {
$("#receveur").html(html);
hello();
}
});