JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container">
<button id="the_button">Click me to show field</button>
</div>
JavaScript
$("#the_button").click(function() {
$elt = $("<input>").attr("type", "text").attr("id", "text_field");
$("#container").append($elt);
$elt.focus();
$elt.blur(function() {
$elt.remove();
});
});