Mega Code Archive

 
Categories / JavaScript DHTML / Language Basics
 

Find the random number in a range

<html> <head> <title>Random Quote</title> <script type="text/javascript"> function getQuote() {    do {      iValue = Math.random();       document.write(iValue+"<BR>");      iValue *= 10;       document.write(iValue+"<BR>");      iValue = Math.floor(iValue);       document.write(iValue+"<BR>");    }    while (iValue > 4)     document.write(iValue); } getQuote(); </script> </head> <body> </body> </html>