<input type="button" class="pro-button" id="btn"
style="color: red; background-color: #FFFAFA;margin-top: 0;"
onclick="setTime(this)" value="获取验证码">
var countDown=60;
function setTime(val) {
if (countDown == 0) {
val.removeAttribute("disabled");
val.value = "获取验证码";
countDown = 60;
return;
} else {
val.setAttribute("disabled", true);
val.value = "重新发送(" + countDown + ")";
countDown--;
}
setTimeout(function () {
setTime(val)
}, 1000)
}