Get value from HTML Text Field Input - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text

Description

Get value from HTML Text Field Input

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){// w w w  .  j a va 2  s. c  om
console.log(document.getElementById("usethisid").value);
    }

      </script> 
   </head> 
   <body> 
      <p> 
         <input type="text" name="name1" id="usethisid" maxlength="100" value="heres my default text"> 
      </p>  
   </body>
</html>

Related Tutorials