Home > Web Front-end > JS Tutorial > body text

JS makes countdown recovery click (forced reading)

php中世界最好的语言
Release: 2018-06-07 11:34:04
Original
2168 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!