JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<button id="btn1">open</button>
<div id="_query_">
  <p>dialog</p>
  <input id='tt1'>

  <input >

                    </div>
T<input id='t'>t1<input id='t1'>

JavaScript

(function($){
    $.extend($.fn.window.methods, {
        watchTab: function(jq){
            return jq.each(function(){
                var opts = $(this).window('options');
                $(this).unbind('.watchTab').bind('keydown.watchTab', function(e){
                    if (opts.modal && e.keyCode == 9){
                        var first = $(this).find(':input:enabled:visible:first');
                        var last = $(this).find(':input:enabled:visible:last');
                        if (e.target == last[0] && !e.shiftKey){
                            first.focus();
                            return false;
                        } else if (e.target == first[0] && e.shiftKey){
                            last.focus();
                            return false;
                        }
                    }
                })
            })
        }
    })
})(jQuery);

$('#t').textbox();

$('#t1').textbox();


$('#_query_').dialog({
    modal: true,
    title: 'My Modal',
    width: 400,
    height:'auto',
    closed:true,
     buttons:[{
				text:'Save',
 			},{
				text:'Close',
 			}]
  });
$('#_query_').dialog('watchTab');

$('#btn1').click(function(){
 var dl = $('#_query_');
dl.dialog('open');
dl.dialog('move',{left:50,top:50});
$('#tt1').focus();
});