SoFunction
Updated on 2025-04-03

Small example of Js registration agreement countdown


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
<TITLE>  Register </TITLE>
  <META NAME="Email" CONTENT="12345678@">
  <META NAME="Author" CONTENT="MXi4oyu">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <script type="text/javascript">

    var s=4;
 function countsub()
 {
   var btnReg=("btnReg");
   if(btnReg)
   {
     if(s<=0)
  {
="Agree";
   =false;
   clearInterval(id);

  }
  else
  {
="Please read the protocol carefully (there are still "+s+" seconds left)";
  s--;
  }
   }
 }
   var id = setInterval('countsub()',1000)
  </script>
 </HEAD>

 <BODY>
<textarea>Registering Agreement</textarea>
<input type="button" value="Agree" disabled="true" />

 </BODY>
</HTML>