Home Article 手机验证码倒计时


Source:手机验证码倒计时 Release time:2020-01-06 Author:Mr.赵 Reading volume:23
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <script src="jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
function get_mobile_code() { time($("#btnSendCode"),$(".yzmtext")); } var wait=5;//时间 function time(o,p) { if (wait == 0) { o.removeAttr("disabled"); o.val("重新发送验证码"); p.html("如果您在1分钟内没有收到验证码,请检查您填写的手机号码是否正确或重新发送"); wait=5; } else { o.attr("disabled", "true"); o.val("(" + wait + ")秒后重新获取"); p.html("如果您在1分钟内没有收到验证码,请检查您填写的手机号码是否正确或重新发送"); wait--; setTimeout(function() { time(o,p);//循环调用 }, 1000) } } </script> </head> <body> <p class="yzmtext"></p> <input id="btnSendCode" type="button" value="发送验证码" onclick="get_mobile_code()" /></p> </body> </html>
I want to comment
Leave a message
User login
You have not written any reviews yet!
You have commented!
Can only praise once!
You have a collection!