关于web中注册倒数的问题(亲测)
<title></title>
<script type="text/javascript">
var leftSecond = 10;
var intervalid;
function CountDown()
{
var btnReg = document.getElementById("btnReg");
if (btnReg)
{
if (leftSecond <= 0)
{
btnReg.value = "同意";
btnReg.disabled = false;
clearInterval(intervalid);
}
else {
btnReg.value = "还剩下" + leftSecond + "秒";
leftSecond--;
}
}
}
intervalid = setInterval("CountDown()", 1000);
</script>
</head>
<body>
<input type="button" id="btnReg" disabled="disabled" value="同意"/>
</body>
</html>