JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" id="btn1" rel="jsfiddle" value="dialog1" />
<input type="button" id="btn2" rel="hackernews" value="dialog2" />
<input type="button" id="btnClose" value="Close">

JavaScript

$(function(){
        var urls = {
            "hackernews" : "http://news.ycombinator.com", 
            "jsfiddle" : "http://jsfiddle.net"
        };

        var dialog = $("<div style='width:50%;height:50%;'>\
                       <iframe id='dialogFrame'\
                       src='#'  frameborder='0'></iframe></div>");
        
        
         dialog.dialog({
          height: 220, 
          title: "Title",
          width: 500,
          modal: true,
          autoOpen: false
        });
  
        $('#btn1, #btn2').click(
            function(){
                var urlIndex = $(this).attr('rel');
                if(!urlIndex) return;
                $('#dialogFrame', dialog).attr('src', urls[urlIndex]);
                dialog.dialog('open');
             }
        );
        $('#btnClose').click(
            function(){
                dialog.dialog('close');
            }
        );
});