Home >Web Front-end >JS Tutorial >JS makes countdown recovery click (forced reading)

JS makes countdown recovery click (forced reading)

php中世界最好的语言
php中世界最好的语言Original
2018-06-07 11:34:042222browse

This time I bring to you what are the precautions. The following is a practical case, let’s take a look.

After the countdown time is up, click the recovery button, which is often used to read the agreement:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>阅读协议倒计时</title>
    <script>
      var tim=9;
      function aaa(){
        var btnn=document.getElementById("btn");
        if(tim<=0)
        {
          btnn.value="注册";
          btnn.disabled="";
        }
        else
        {
          btnn.value="请仔细阅读,还剩"  +tim+"秒";
          tim--;
        }
      }
      setInterval("aaa()",1000);
    </script>
  </head>
  <body>
    <textarea style="width: 500px;height: 300px;">
    </textarea>
    <input type="button" id="btn" value="请仔细阅读,还剩10秒" disabled="disabled" />
  </body>
</html>

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

How to operate Vue to make a proxy agent

How to manage the vue project api interface

The above is the detailed content of JS makes countdown recovery click (forced reading). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn