function settime(obj) { if(second == 0){ obj.removeAttribute("disabled"); obj.value="获取验证码"; second = 300; return; }else{ obj.setAttribute("disabled", true); obj.value="重新发送(" + second + ")"; second--; } timeId = window.setTimeout(function(){settime(obj)},1000); };
obj参数传入this即可。
原文地址:https://www.cnblogs.com/qiaoyutao/p/10155579.html
时间: 2024-11-09 03:10:27