会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
诩小贝
web前端攻城狮,正在成长中,有什么问题可以联系,一起成长
首页
新随笔
联系
管理
2018年1月22日
JS中,输出1-10之间的随机整数
摘要: document.write(parseInt(10*Math.random())); //输出0~10之间的随机整数 document.write(Math.floor(Math.random()*10+1)); //输出1~10之间的随机整数 function RndNum(n){ var rnd=""; for(var i=0;i<n;i++) rnd+=Math.floor(Mat...
阅读全文
posted @ 2018-01-22 16:42 诩小贝
阅读(12637)
评论(0)
推荐(0)
编辑
公告
Copyright ©2016 诩小贝 联系QQ:980823367