![]()
![]()
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>淘宝倒计时</title>
<script>
window.onload=function(){
var oBut=document.getElementById('but');
var oName=oBut.value;
var timer=null;
but.onclick=function(){
var n=5;
clearInterval(timer);
timer=setInterval(function(){
//oName='秒后重新发送';
//alert('oo');
//alert(n--);
oName=n--+'秒后重新发送';
//alert(oName)
oBut.value=oName;
if(n==0)
{
//alert('ok');
clearInterval(timer);
oBut.value='免费获取验证码';
};
},1000);
};
};
</script>
</head>
<body>
<input id='but' type="button" value="免费获取验证码">
</body>
</html>