JavaScript Math.random() 函数
Math.random() -- 返回0和1之间的伪随机数 可能为0,但总是小于1,[0,1)
document.write(Math.random());
返回随机数
document.write(Math.random()*(20-10) 10);
返回10-20的随机数
document.write(Math.random()*(n-m) m);
返回指定范围的随机数(m-n之间)的公式转载请注明:前端录»JavaScript Math.random() 函数
<script src="http://www.wozhuye.com/index.php?m=digg&c=index&a=init&id=20-36-2"></script>