Assign function to window.onload - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window Load


Assign function to window.onload

Demo Code

ResultView the demo in separate window

function LoadArray(){/*from   w  ww  . j  a v  a  2s  . c o  m*/
    var randomnumber=new Array();
    for(var i=0; i<=10; i++)
    document.getElementById("h_field").value = randomnumber[0];
 window.onload = LoadArray;

      <form id="myform" action="b.php" method="GET"> 
         <input type="hidden" id="h_field" name="h_field"> 
         <input type="Submit" value="my button"> 

Related Tutorials