按钮60秒倒计时
var wait = 60; function timeDown(obj){ if( wait === 0 ){ obj.removeAttribute('disabled'); obj.value = "获取验证码"; wait = 60; }else{ obj.setAttribute('disabled',true); obj.value="重新发送" + wait +""; wait--; setTimeout(function(){ timeDown(obj) },1000) } } $('.btnCode').on('click',function(){ timeDown(this); })
全部教程http://each.sinaapp.com/angular/index.html