After clicking the "Send Verification Code" button, the button appears as "Retry after 59 seconds", "Retry after 58 seconds" ... Revert to "Send verification code" until the countdown to 0 seconds is displayed. The button is disabled during the countdown
PS: When the countdown starts. To clear the timer. Do not click to speed up the number of seconds.
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Document</title> <Scripttype= "Text/javascript">window.onload= function () { varSend=document.getElementById ('Send'), times= -, Timer= NULL; Send.onclick= function () { //Timing StartsTimer=SetInterval (function() { times--; if( times<= 0) {Send.value= 'Send Verification Code'; Clearinterval (timer); Send.disabled= false; } Else{Send.value= Times+ 'seconds after retry'send.disabled= true; } Console.log (Times)}, +) } } </Script></Head><Body><inputtype= "button"ID= "Send"value= "Send Verification Code"></Body></HTML>
Submit knob submit once plus 59 seconds countdown