varwait = 60;//Time functionTime (O, p) {//O is the object of the button, p is optional, here is 60 seconds later, the prompt text changes if(wait = = 0) { //o.removeattr ("Disabled"); //o.val ("Click to send Verification Code");//Change the value of the button //p.html ("If you do not receive the verification code within 1 minutes, please check if your mobile phone number is correct or re-sent");$ (' # ' +p). Removeattr ("style"); $(' # ' +p). attr ("style", "Display:none;"); $(' # ' +o). Removeattr ("style"); $(' # ' +o). attr ("style", "Display:inline-block;"); Wait= 60; } Else { //o.attr ("Disabled", "disabled");//No click button during Countdown //o.val (wait + "seconds to regain verification code");//Change the value of the button$ (' # ' +p). HTML ("sent, valid for 5 minutes <br/>" +wait+ "seconds to regain"); Wait--; SetTimeout (function() {Time (o, p);//Loop Call}, 1000) } }
jquery implementation of mobile phone verification Code Countdown Code _javascript Tutorial _ triple http://www.3lian.com/edu/2014/02-13/128689.html