jQuery 发送验证码倒计时按钮

复制代码
  1. {
  2. wait:90,
  3. hsTime:function(that){
  4. if (this.wait == 0) {
  5. $('#hsbtn').removeAttr("disabled").val('重发短信验证码');
  6. this.wait = 90;
  7. } else {
  8. var _this = this;
  9. $(that).attr("disabled", true).val('在'+_this.wait+'秒后点此重发');
  10. _this.wait--;
  11. setTimeout(function() {
  12. _this.hsTime(that);
  13. }, 1000)
  14. }
  15. },
  16. }
复制代码

 

原文地址:https://www.cnblogs.com/xiaohong/p/4236279.html