Dynamically add input box to text

PHOTO EMBED

Thu Aug 06 2020 14:18:32 GMT+0000 (Coordinated Universal Time)

Saved by @MarkJason #undefined

<!DOCTYPE html>
<html>
<body>
​
<p>Click the button to create a Text Field.</p>
​
<button onclick="myFunction()">Try it</button>
​
<script>
function myFunction() {
  var x = document.createElement("INPUT");
  x.setAttribute("type", "text");
  x.setAttribute("value", "Hello World!");
  document.body.appendChild(x);
}
</script>
​
</body>
</html>
​
content_copyCOPY

https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_text_create