jweinst1
9/7/2015 - 7:34 PM

simple text output form for html

simple text output form for html

<!DOCTYPE html>
<html>
<body>
<div class="boxed">
<form>
  Input Text:<br>
  <input type="text" class="inputtext" id="input" name="firstname" size="70">

</form>
<br>Output Text:<br>
<textarea class="outputtext" rows="6" cols="45" id="output">
</textarea>

<button class="gentext" onclick="myFunction()">Transfer text</button>

<style>
input.inputtext {
    position: relative;
    left: 20px;
}
textarea.outputtext {
    position: relative;
    left: 20px;
}
button.gentext {
    position: relative;
    left: 20px;
}
.boxed {
  border: 1px solid red;
  margin:20px;
}
</style>
<script>
function myFunction() {
    var x = document.getElementById("input").value;
    document.getElementById("output").value = x;
}
</script>
</div>


</body>
</html>