<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
</head>
<body>
<button id="sendCaptcha">
发送验证码
</button>
<script type="text/javascript">
var count;
var t;
function countdown(){
if (count == 0) {
$("#sendCaptcha").text("发送验证码");
$("#sendCaptcha").removeAttr("disabled");
clearTimeout(t);
} else{
$("#sendCaptcha").attr('disabled','disabled');
$("#sendCaptcha").text('重新发送('+count+')');
count--;
setTimeout(countdown, 1000);
}
}
$("#sendCaptcha").click(function(){
count = 60;
t = setTimeout(countdown, 1000);
})
</script>
</body>
</html>