Javascript examples for Array Operation:Array Element
Generate array with random number
<html> <head> <script> function LoadArray(){/* w w w . j a v a 2 s. c o m*/ var randomnumber=new Array(); for(var i=0; i<=10; i++) { randomnumber[i]=Math.random(); } document.getElementById("h_field").value = randomnumber[0]; } window.onload = LoadArray; </script> </head> <body> <form id="myform" action="b.php" method="GET"> <input type="hidden" id="h_field" name="h_field"> <input type="Submit" value="my button"> </form> </body> </html>