js短信验证码时间

Posted summarize

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了js短信验证码时间相关的知识,希望对你有一定的参考价值。

短信验证码时间

比较简单直接上代码:

var wait = 60;
timeOut();
function timeOut() {
  if (wait == 0) {
    $(‘#code‘).text("重新获取验证码");
  } else {
    setTimeout(function () {
      wait--;
      $(‘#code‘).text(wait);
      timeOut();
    }, 1000)
  }
}













以上是关于js短信验证码时间的主要内容,如果未能解决你的问题,请参考以下文章