随机选号1-60
<script type="text/javascript">
var xh; //声明变量“xh”
function a() //命名函数 a()
{ var b=Math.floor(Math.random()*60+1); //产生随机数10-60赋值给b;
document.getElementById("wb").value=b; //将b赋值给文本框;
xh=setTimeout("a()",60); //使用定时器函数,60毫秒调用函数;
}
function c() //定义函数 c();
{ clearTimeout(xh); //清除定时器函数
}
</script>