Best Download Sites Login
Site Login

Random Number Within A Set Range

Description
Pass a range of numbers to this JavaScript function and it will return a random number within that range. For example, passing the range of [1, 158] would return a number such as 37, 141, 18, etc....View A Script Demo


Do you find it confusing setting up these script?
Java Scripts Magic can do all the hard work for you all At The Touch Of A Button.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<LINK href="general.css" rel="stylesheet" type="text/css">

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
//  End -->
</script>

</HEAD>

<BODY Background=../graphics/grayback.jpg>
<center><BR><BR><BR>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write("Random number in [1, 158]:  ");
document.write(getRandomNum(1,158));
//  End -->
</script>

</center>
</BODY>
</HTML>
 

Business Proposal If you have a Business Proposal that you think may be of interest to us here at Best Download Sites please contact us to discuss the matter in further detail