JSFiddle - React, Tailwind, and code Playground

by alnitak

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css">

JavaScript

function myalert(title, text) {
    var div = $('<div>').html(text).dialog({
        title: title,
        modal: true,
        close: function() {
            $(this).dialog('destroy').remove();
        },
        buttons: [{
            text: "Ok",
            click: function() {
                $(this).dialog("close");
            }}]
    })
};

myalert("Test", "This is a test modal dialog");