JSFiddle - React, Tailwind, and code Playground

by marcosfromero

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css">
<div id="hello">world!</div>

<div id="goodbye">mars!</div>

<input type="button" id="world" value="hello" /> <input type="button" id="mars" value="goodbye" />

CSS

#hello, #goodbye {
    width: 100px;
    height: 100px;
}

JavaScript

$('#hello, #goodbye'). //Get the box
    dialog({autoOpen: false}).          //Open dialog
    prev('.ui-dialog-titlebar').  //find title bar (with X close button)
    find('a').         // get the X close button
    hide();            // hide it
            
$('#world, #mars').click(function() {$('#' + this.value).dialog('open');});