random()方法2

2017-06-16 15:10:00
admin
原创
515
<!DOCTYPE html>
<html>
<head>
    <title>Math Object Random Example 2</title>
    <script type="text/javascript">
        var num = Math.floor(Math.random() * 9 + 2);
        alert(num);    //a number between 2 and 10
        
    </script>
</head>
<body>

</body>
</html>
  • QQ讨论群
  • 关注微信
    • 欢迎咨询
    • 欢迎加入QQ群 16506021
  • 公众号:源宝网络