<button id="sendNewEmail" type="button">获取验证码</button></li>
var $sendNewEmail=$("#sendNewEmail");
time($sendNewEmail,60);
function time(o,wait) {
var $this = $(o);
if (wait == 0) {
$this.css('pointer-events', '');
$this.css("background","#549ff2");
$this.html("发送验证码");
wait = 60;
} else {
$this.css("pointer-events","none");
$this.css("background","#999999");
$this.html("重新发送(" + wait + ")");
wait--;
setTimeout(function() {
time(o,wait)
},
1000)
}
}
<button id="sendPhone" disabled="disabled" type="button" style="background: #bdb1a5;">获取验证码</button></li>
$("#sendPhone").attr("disabled", false);