JSFiddle - React, Tailwind, and code Playground

HTML

<div id="dialogbox"></div>
<input id="mybutt" type="button" value="Click Me">

JavaScript

$("#dialogbox").dialog({
    autoOpen:false,
    modal:true,
    title: "Use of Open event",
    width:300,
    open: function( event, ui ) {
        alert('hello');
    }
});

$('#mybutt').click(function() {
    $('#dialogbox').html('<h2>Watch this</h2>An alert box should have opened');
    $('#dialogbox').dialog('open');
});