Set value to textbox without button click - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text

Description

Set value to textbox without button click

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  ww w.ja  va 2 s  . c o m*/
console.log(document.getElementById('fake').value);
    }

      </script> 
   </head> 
   <body> 
      <input type="text" name="fake" id="fake" readonly value="example">  
   </body>
</html>

Related Tutorials