JSFiddle - React, Tailwind, and code Playground

by WK_of_Angmar

HTML

<p>What's your age now:
    <input type="text" id="txtAge">
</p>
<input type="button" id="button" value="Go!">

JavaScript

window.onload = function() {
    document.getElementById("button").onclick = btnOnclick;
};

function btnOnclick() {
    var elemValue = document.getElementById("txtAge").value;
    var myWindow = window.open();
    myWindow.document.write("<input type=\"text\" readonly=\"readonly\" id=\"txtAge\" value=\"" + elemValue + "\">");
    myWindow.focus();
};