注意,a标签没有disabled属性,所以建议使用button
var count = 0 send_count_down: function () { var code = document.getElementById('sendCode') if (count == 0) { code.style.color = '#FEC901'; code.removeAttribute('disabled') code.innerHTML = "获取验证码"; count = 60; return; } else { code.style.color = '#A9A9A9' code.setAttribute('disabled', true) code.innerHTML = "重新发送(" + count + ")"; count--; } setTimeout(function () { login.send_count_down() }, 1000) },