实例79.体育彩票选号器.html
来自「JSP网页中用到的JavaScript特效」· HTML 代码 · 共 33 行
HTML
33 行
<script language="javascript">
<!--
function checkp()
{
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;
}
var idx;
var powerball = new Array(6);
powerball = this.checkp();
document.write("<center>");
document.write("<hr width=400><font size=5>");
for(idx = 0; idx < 5; idx++)
document.write(powerball[idx] + " - ")
document.write("</font><font color=#D00000 size=5>" + powerball[idx] + "</font>");
document.write("</center>");
//-->
</script>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?