send.onclick=function(){
send.disabled='disabled';
send.value=times+'秒后重试';
timer=setInterval(function(){
if(--times!=0)
send.value=(times)+'秒后重试';
else{
send.value='发送验证码';
send.disabled='';
times=5;
clearInterval(timer);
}
},1000)
send.disabled='disabled';
send.value=times+'秒后重试';
timer=setInterval(function(){
if(--times!=0)
send.value=(times)+'秒后重试';
else{
send.value='发送验证码';
send.disabled='';
times=5;
clearInterval(timer);
}
},1000)
function autochange(){ times--; if(times==0){
send.value="发送验证码";
send.style.color="black";
clearInterval(timer); send.disabled=false;
}else{send.value=times+"秒后重试"; } } } }
send.value="发送验证码";
send.style.color="black";
clearInterval(timer); send.disabled=false;
}else{send.value=times+"秒后重试"; } } } }
<script type="text/javascript">
window.onload=function(){
var send=document.getElementById("send");
timer=null;
send.onclick=function(){
times=60;
send.disabled=true;
send.style.color="#aaa";
send.value=times+"秒后重试";
window.onload=function(){
var send=document.getElementById("send");
timer=null;
send.onclick=function(){
times=60;
send.disabled=true;
send.style.color="#aaa";
send.value=times+"秒后重试";