js 获取范围内的随机数
function RandomNum(Min,Max){ var Range = Max - Min; var Rand = Math.random(); var num = Min + Math.round(Rand * Range); return num; } RandomNum(10,20);
转载自:http://blog.sina.com.cn/s/blog_a22183250102vfya.html
function RandomNum(Min,Max){ var Range = Max - Min; var Rand = Math.random(); var num = Min + Math.round(Rand * Range); return num; } RandomNum(10,20);
转载自:http://blog.sina.com.cn/s/blog_a22183250102vfya.html