Blogger Information
Blog 55
fans 0
comment 0
visits 59136
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
验证码倒计时
南鸢离梦的博客
Original
611 people have browsed it
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
  6. <script type="text/javascript">
  7. var countdown=60;
  8. function sendemail(){
  9. var obj = $("#btn");
  10. settime(obj);
  11. }
  12. function settime(obj) { //发送验证码倒计时
  13. if (countdown == 0) {
  14. obj.attr('disabled',false);
  15. //obj.removeattr("disabled");
  16. obj.val("免费获取验证码");
  17. countdown = 60;
  18. return;
  19. } else {
  20. obj.attr('disabled',true);
  21. obj.val("重新发送(" + countdown + ")");
  22. countdown--;
  23. }
  24. setTimeout(function() {
  25. settime(obj) }
  26. ,1000)
  27. }
  28. </script>
  29. <body>
  30. <input type="button" id="btn" value="免费获取验证码" onclick="sendemail()" />
  31. </body>
  32. </html>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post