<!DOCTYPE html>
<html>
<body>
<form>
Input Text:<br>
<input type="text" id="input" name="firstname">
<br>
Output Text:<br>
<input type="text" id="output" name="lastname">
</form>
<button onclick="myFunction()">Transfer text</button>
<script>
function myFunction() {
var x = document.getElementById("input").value;
document.getElementById("output").value = x;
}
</script>
<p>Note that the form itself is not visible.</p>
<p>Also note that the default width of a text input field is 20 characters.</p>
</body>
</html>