Set input value vis document.getElementById().value - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Number

Description

Set input value vis document.getElementById().value

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() {//www.  j a v a 2 s  . c  o  m
document.getElementById('points').value = 100;
console.log(document.getElementById('points').value);
    });

      </script> 
   </head> 
   <body> 
      <form> 
         <input type="number" id="points" value="0"> 
      </form>  
   </body>
</html>

Related Tutorials