Js随机数--网页版的体育彩票选号器
2016-06-20 10:35
288 查看
<script> function Quickpick() { var ball for( ball = 0; ball < 5; ball++) { this[ball] = parseInt((Math.random() * Math.pow(10,16)) % 49) + 1; for(var list = 0; list < ball; list++) { if(this[list] == this[ball]) { list = ball; ball--; } } } this[ball] = parseInt((Math.random() * Math.pow(10,16)) % 42) + 1; return this; } console.log(Quickpick()); var idx; var powerball = new Array(6); powerball = this.Quickpick(); document.write("<center>"); document.write("体育彩票选号器"); document.write("<hr width=400><font size=+2>"); for(idx = 0; idx < 5; idx++) document.write(powerball[idx] + " - ") document.write("</font><font color=#D00000 size=+2>" + powerball[idx] + "</font>"); document.write("</center>"); </script>
相关文章推荐
- JS 检测是否联网
- 【转发】JS中如何判断null/ undefined/IsNull
- JavaScript设置进度条
- js 跨浏览器事件解决方法
- js闭包
- JSP登录前后改变JSESSIONID
- javascript js 操作数组 增删改查的简单实现
- JavaScript split() 方法
- 智能浮动表头
- 百度坐标转换 的异步转码问题
- 浅谈JavaScript中数组的增删改查
- 【经验总结】编写JavaScript代码时应遵循的14条规律
- JSP内置对象——response
- JS里面怎么去掉字符的空格
- js 内容模版
- javascript实现随机生成DIV背景色
- javascript 减少回流
- JavaScript—文字自动变化为自定义颜色
- JS实现弹出居中的模式窗口示例
- My12306 Project日志——JavaScript动态表格