Script Categories













Miscellaneous >>> R Numbers.

Use this script to pick 16 random numbers. Lottery, for fun or whatever.

Step 1: Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">      
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
num= new Array(16);
for (i=0; i<16; i++) {
num[i]=Math.floor(16*Math.random()+1);
if (num[1]==num[0]) {
while (num[1]==num[0]) {
num[1]=Math.floor(16*Math.random()+1);
   }
}
if (num[2]==num[1] || num[2]==num[0]) {
while (num[2]==num[1] || num[2]==num[0]) {
num[2]=Math.floor(16*Math.random()+1);
   }
}
if (num[3]==num[2] || num[3]==num[1] || num[3]==num[0]) {
while (num[3]==num[2] || num[3]==num[1] || num[3]==num[0]) {
num[3]=Math.floor(16*Math.random()+1);
   }
}
document.write(num[i],", ");
}
// End -->
</script>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).




©