JSFiddle - React, Tailwind, and code Playground

HTML

<html>

<head>

<!-- LOAD JQUERY LIBRARY: -->  
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>



</head>

<body>
<div style="display:none" id="dd">
<div id="d1">
   
</div>

</div>
<p><input type="submit" id="button1" value="Submit" name="B1"></p>

</body>

</html>

JavaScript

$(document).ready(function() {
var z;




                $('#dd').dialog({ 
                                    autoOpen:   true,
                                    modal:      true,
                                    overlay:    { opacity: 0.5, background: 'black'},
                                    title:      'Select the date:',
                                    height:     215, 
                                    width:      234,
                                    draggable:  false, 
                                    resizable:  false

                });//end of dialog_atip


$('#d1').datepicker({
            onSelect:function(){
                    z = $(this).val();
                    alert(z);
                    $("#dd").dialog("close");
            }

});



//end of window.onload

 $('#button1').click(function()
                     {                     
                        alert(z); 
                     });
                    
       });