近期用到产生指定范围内随机数,琢磨了一下,码了下砖
<html>
<body>
<script type="text/javascript">
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
alert(getRandomInt(100000,10000000))
</script>
</body>
</html>