<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
window.onload=function(){
var send=document.getElementById('send'),
times=60,
timer=null;
send.onclick=function(){
// 计时开始
send.value=''+times+'秒后重试'
clearInterval(timer);
timer = setInterval(function(){
if(times > 0){
times--;
send.value=''+times+'秒后重试'
}else{
clearInterval(timer);
send.value='发送验证码';
}
},1000)
}
}
</script>
</head>
<body>
<input type="button" id="send" value="发送验证码">
</body>
</html>
大饭团CC
2014-09-16
举报
0/150
提交
取消