JSFiddle - React, Tailwind, and code Playground

by sethj

HTML

<head>
  <title>jQuery UI Dialog - Default functionality</title>
</head>
<body>

</body>

JavaScript

// initialize title and body variables
var someVariable = "Some text";
var someTitle = "My title";

var createDialog = function(text , title) {
    //create dialog <div> shell
    var dialog =  "<div id=dialog <h1>" + text + "</h1></div>";
    
    // create the dialog <div>
    $('body').append(dialog);
    
    // update the <div>'s title
    $('#dialog').prop('title' , title);
    
    //create the dialog
    $('#dialog').dialog();
}

createDialog(someVariable , someTitle);