<!DOCTYPE html> <html> <head> <title></title> <script src="../scripts/jquery.js" type="text/javascript"></script> <script> $(function () { var util = { wait: 90, hsTime: function (that) { _this = $(this); if (_this.wait == 0) { $(‘#hsbtn‘).removeAttr("disabled").val(‘重发短信验证码‘); _this.wait = 90; } else { var _this = this; $(that).attr("disabled", true).val(‘在‘ + _this.wait + ‘秒后点此重发‘); _this.wait--; setTimeout(function () { _this.hsTime(that); }, 1000) } } } util.hsTime(‘#hsbtn‘); $("#hsbtn").click(function(){ util.hsTime(‘#hsbtn‘); }) }) </script> </head> <body> <input type="button" id="hsbtn" /> </body> </html>
时间: 2024-10-12 21:00:12