jquery Implementation Countdown button function code sharing _jquery

Source: Internet
Author: User

Code One:

{ 
 wait:90,
 
 hstime:function (that) {
 
   if (this.wait = 0) { 
    $ (' #hsbtn '). Removeattr ("Disabled"). Val (' Re-send SMS Verification code ');   
    this.wait = n 
   else { 
    var _this = this;
    $ (that). attr ("Disabled", true). Val (' After ' +_this.wait+ ' seconds to post this postback);
    _this.wait--; 
    settimeout (function () { 
     _this.hstime (that); 
    }, 1000) 
   }} 
  ,
}

Code two:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

code three:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

code four:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

Code Five:

Recently wrote a text message to send the verification code, wrote a js/jquery countdown to send the verification code button
<script language= "javascript" src= "Jquery-1.7.1.min.js" ></ script>
<input type= "button" id= "btn" value= "Free access to authentication code"/> <script type= "
text/javascript" >
var wait=10;
function Time (t) {
  if (wait = = t) {
   t.removeattribute ("Disabled");   
   T.value= "Free access to Verification code";
   wait = ten;
  } else {
   T.setattribute ("disabled", true);
   T.value= "Resend (" + Wait + ")";
   wait--;
   settimeout (function () {Time
    (t)
   },
   1000)
  }
 $ (document). Ready (function () {
 $ ("#btn"). Click (function () {Time 
 
(this);
}); </script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.