jquery 实现倒计时60秒并清除定时器项目中很常见

jquery 实现倒计时60秒并清除定时器项目中很常见

 

var wait=60;
$('#AutoCode').text(wait+'s');
timer = setInterval(function(){
if(wait==0){
$('#AutoCode').text('获取验证码');
clearInterval(timer)
}else{
wait--;
$('#AutoCode').text(wait+'s');
}
},1000);

相关文章:

  • 2021-11-17
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2022-02-03
  • 2021-12-09
猜你喜欢
  • 2022-12-23
  • 2021-09-02
  • 2021-11-17
  • 2022-12-23
  • 2021-12-31
相关资源
相似解决方案