Javascript examples for DOM HTML Element:Input Text
Adding value to dynamically made input text tag
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w .j ava2 s.c o m var formElement = document.createElement('input'); formElement.type = 'text'; formElement.defaultValue = "test"; formElement.name="test2"; console.log(formElement); } </script> </head> <body> </body> </html>