JSFiddle - React, Tailwind, and code Playground

by jstenkvist

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css">
<div id="target"></div>

JavaScript

$(document).on("dialogopen", ".ui-dialog", function(event, ui) {
    alert("opened");
});

//setTimeout(function() {
    var target = $("#target");
    var dialog = $('<div>New Dialog</div>').appendTo($("#target")).dialog({
        autoOpen:false
    });
    $("<button>Open</button>").appendTo($("#target")).click(function() {
        dialog.dialog("open");
    });
//}, 2000);