JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<input type="text" value="type something" id="myField"></input>
</div>
<div id="modal" class="hidden">
<div>
<p>hey, I have got the field ! \o/</p>
<p> hello </p> <p id="target"> </p>
</p>
</div>
</div>
<input type="button" value="generate the modal" id="theButton"></input>
CSS
.hidden{display:none;}
JavaScript
$("#theButton").click(function(){
var field = $("#myField");
$("#target").html(field.val());
$("#modal").dialog();
});