HTML input name and get value from it - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Form Event

Description

HTML input name and get value from it

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(){/*from   www  .j  a v a  2  s .  c om*/
myFunc = function(){
   console.log(document.getElementById("name").value);
}
    }

      </script> 
   </head> 
   <body>
       Name 
      <input type="text" id="name" onKeyUp="myFunc()">  
   </body>
</html>

Related Tutorials