代码只能执行一次如何修改?
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input type="button" id="send" value="发送验证码">
<script type="text/javascript">
window.onload=function(){
var send=document.getElementById('send'),
times=60,
timer=null;
send.onclick=function(){
timer = setInterval(countDown,1000);
}
function countDown(){
times-=1;
send.setAttribute('disabled','disabled');
if(times<0){
clearInterval(timer);
send.setAttribute("value","重新发送验证码");
send.removeAttribute('disabled');
}
else
{
send.setAttribute("value",times+"秒后重试");
}
}
}
</script>
</body>
</html>