javascript 使用 setInterval 实现倒计时

var timer = setInterval(function () {
    console.log(valid_time);
    if (valid_time-- < 1) {
        window.clearInterval(timer);
        $('#switch').attr('disabled', true);
    }
}, 1000);

相关文章:

  • 2021-10-16
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2021-05-06
  • 2021-09-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-11-30
  • 2022-12-23
  • 2021-12-15
相关资源
相似解决方案