抽签

<span style="font-size:18px;"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>抽签 </TITLE>
<SCRIPT LANGUAGE="JavaScript">
var names = [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10"
];
var time;
function begin(){
document.getElementById("btnBegin").disabled = true;
chouqian();
}
function chouqian(){
var index = Math.floor(Math.random()*1000 % names.length);
var name = names[index];
document.getElementById("result").innerHTML = name;
time = window.setTimeout(chouqian,2);
}
function end(){
window.clearTimeout(time);
document.getElementById("btnBegin").disabled = false;
}
</SCRIPT>
</HEAD>

<BODY>
<div style="text-align:center;margin-top:100px">
<h1>抽签程序</h1>
<h3 id="result" style="color:blue"></h3>
<INPUT TYPE="button" VALUE="开始" id="btnBegin" ONCLICK="begin();"> 
<INPUT TYPE="button" VALUE="结束" id="btnEnd" ONCLICK="end();">
</div>
</BODY>
</HTML></span>

posted on 2019-09-05 18:05  睡梦中的雄狮  阅读(182)  评论(0编辑  收藏  举报