<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var startat=5;
function disableRegBtn(bdisable){
document.getElementById("regBtn").disabled=bdisable;
}
function showTime(){
if(startat==0){
clearInterval(timeId);
document.getElementById("p1").innerHTML="";
disableRegBtn(true);
return;
}
document.getElementById("p1").innerHTML=startat + "";
startat--;
}
window.onload=function(){
document.getElementById("taid").readOnly=true;
disableRegBtn(true);
timeId=setInterval("showTime()",1000);
}
</script>
<textarea id="taid" cols="30" rows="5">:
1.
2.
3.
</textarea> <p id="p1"><input id="regBtn" type="button" value="" />
</body>
</html>
countdown, after 5 4 3 2 1, it shows "can register now"
but
<input id="regBtn" type="button" value="" />
cannot be displayed. The disableRegBtn (true);
in the
showTime function cannot be written as
disableRegBtn (fasle);
disableRegBtn ("disabled");