JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
<meta charset="utf-8" />
<style>
</style>
</head>
<body>
<div>
<form>
<br /><br /> Type in your text: <br />
<p>
<input type="text" size="30" id="input" onkeyup="convertToUppercase()" />
</p>
<p id="output"></p>
</form><br />
<button onclick="myFunction()">Open new window</button>
</div>
<script>
var text = ''
function convertToUppercase() {
text = document.getElementById('input').value.toUpperCase()
document.getElementById('output').innerHTML = text;
}
function myFunction(val) {
var myWindow = window.open("", "MsgWindow", "width=200,height=100");
myWindow.document.write("The word is:" + text);
}
</script>
</body>
</html>