During registration, you need to send an email to verify the activation account. To avoid repeated sending of the email, you can set the button to continue clicking after you click send. The following is a simple example:
Copy codeThe Code is as follows:
<Html>
<Head>
<Title> click the get verification code button and the button becomes grayed out. You can click it again after a countdown period. </title>
</Head>
<Body>
<Input type = "button" id = "btn" value = "get verification code for free"/>
<Script type = "text/javascript">
Var wait = 60;
Function time (o ){
If (wait = 0 ){
O. removeAttribute ("disabled ");
O. value = "get verification code for free ";
Wait = 60;
} Else {
O. setAttribute ("disabled", true );
O. value = wait + "you can resend it in seconds ";
Wait --;
SetTimeout (function (){
Time (o)
},
1000)
}
}
Document. getElementById ("btn"). onclick = function () {time (this );}
</Script>
</Body>
</Html>