html dom input text object

Solutions on MaxInterview for html dom input text object by the best coders in the world

showing results for - "html dom input text object"
Sarah
25 Oct 2019
1<!DOCTYPE html>
2<html>
3<body>
4
5<input type="text" id="myText" value="Here is were your Text Input goes">
6
7<button onclick="myFunction()">Try it</button>
8
9<p id="output"></p>
10
11<script>
12function myFunction() {
13  var x = document.getElementById("myText").value;
14  document.getElementById("output").innerHTML = x;
15}
16</script>
17
18</body>
19</html>
20