var sendstatus = true;
$('#sendCode').click(function () {
var _this = $(this);
if (sendstatus) {
_this.html('60秒重发');
sendstatus = false;
sendtime = 60;
sendevent = setInterval(function () {
if (sendtime > 0) {
sendtime--;
_this.html(sendtime + '秒重发');
$("#sendCode").attr('disabled', true);
} else {
sendstatus = true;
_this.html('发送验证码');
clearInterval(sendevent);
$("#sendCode").attr('disabled', false);
}
}, 1000);
}
});
网友评论