//最大值 5 最小值 1var fround = LimitRandom(1,5)alert(fround); function LimitRandom(min,max){ var fRound = Math.floor(Math.random()*(max-min+1)+min); return fRound; }