标签:ack 按钮 fun disable function lse settime var 发送
按钮
<a href="javasript:void(0);"onclick="settime(this);">获取手机验证码</a>
倒计时js
<script> var countdown=60; function settime(obj) { if (countdown == 0) { obj.getAttributeNode(‘onclick‘).value ="settime(this);"; obj.textContent="免费获取验证码"; countdown = 60; return; } else { obj.getAttributeNode(‘onclick‘).value ="javascript:void(0);"; obj.setAttribute("disabled", true); obj.textContent="重新发送(" + countdown + ")"; countdown--; } setTimeout(function() { settime(obj) },1000) } </script>
标签:ack 按钮 fun disable function lse settime var 发送
原文地址:https://www.cnblogs.com/wangzhaobo/p/9055561.html