查看: 328  |  回复: 0
  js 生成4位随机数字
楼主
发表于 2024年4月13日 12:01
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<script type="text/javascript">
    var randomNumber = Math.floor(Math.random() * 1000) + 1000; // 生成 4 位随机数字
    alert(randomNumber);
</script>
</body>
</html>


您需要登录后才可以回帖 登录 | 立即注册
【本版规则】请勿发表违反国家法律的内容,否则会被冻结账号和删贴。
用户名: 立即注册
密码:
2020-2024 MaNongKu.com