<head>
<title>手机号码摇号</title>
<script type="text/javascript">
var timer;
function startDo() {
for (var i = 0; i < 9; i++) {
stopDo();
var rand = Math.random() * 100000;
rand = parseInt(rand % 10);
document.form1.n[i].value = rand;
}
timer = setTimeout("startDo()", 100);
}
function stopDo() {
clearTimeout(timer);
}
</script>
</head>
<body>
<font color="#66ffcc" size="+6">手机号码摇奖</font>
<form name="form1">
<input type="text" name="n11" value="1" />
<input type="text" name="n22" value="3" />
<input type="text" name="n" />
<input type="text" name="n" />
<input type="text" name="n" />
<input type="text" name="n" />
<input type="text" name="n" />
<input type="text" name="n" />
<input type="text" name="n" />
<input type="text" name="n" />
<input type="text" name="n" />
<br><br><br><br><br>
<input type="button" value="开始" onclick="startDo()" class="btn" />
<input type="button" value="停止" onclick="stopDo()" class="btn" />
</form>
</body>
效果图