验证码倒计时
来源:互联网 发布:福昕阅读器有mac版吗 编辑:程序博客网 时间:2024/06/05 02:13
<input id="mobile" placeholder="请输入验证码" maxlength="6">
<input type="button" id="btn" value="免费获取验证码" />
<script type="text/javascript">
var wait = 30;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value = "免费获取验证码";
wait = 30;
} else {
o.setAttribute("disabled", true);
o.value = "重新发送(" + wait + ")";
wait--;
setTimeout(function() {
time(o)
}, 1000)
}
}
//document.getElementById("btn").onclick=function(){time(this);}
$("#btn").on('click', function() {
var mobile = $("#mobile").val();
if (mobile == null || mobile == '') {
alert("验证码不能为空")
} else {
time(this);
}
})
<input type="button" id="btn" value="免费获取验证码" />
<script type="text/javascript">
var wait = 30;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value = "免费获取验证码";
wait = 30;
} else {
o.setAttribute("disabled", true);
o.value = "重新发送(" + wait + ")";
wait--;
setTimeout(function() {
time(o)
}, 1000)
}
}
//document.getElementById("btn").onclick=function(){time(this);}
$("#btn").on('click', function() {
var mobile = $("#mobile").val();
if (mobile == null || mobile == '') {
alert("验证码不能为空")
} else {
time(this);
}
})
0 0
- 获取验证码倒计时
- 短信验证码倒计时
- 验证码倒计时效果
- 验证码倒计时发送
- Android验证码倒计时
- JS验证码倒计时
- 验证码倒计时函数
- 验证码倒计时代码
- 验证码倒计时
- 验证码倒计时
- ios 验证码倒计时
- Android 验证码倒计时
- Android验证码倒计时
- 获取验证码倒计时
- 验证码倒计时
- 验证码倒计时 实现
- ios 验证码倒计时
- 验证码倒计时
- Mach-O 可执行文件
- Sql或者hql 查询时 需要多条件时可以使用嵌套查询
- 设计模式的6大准则
- jQuery清除数组中的空值
- 数据存储接口测试用例
- 验证码倒计时
- Python——函数
- 报错 There is no Action mapped for namespace / and action name upload/.
- Codeforces 797D Broken BST dfs+模拟
- WAV文件格式
- Python常见正则表达式
- pycharm 2016.2注册码
- Android 之旅:Google 发布 Android 性能优化典范
- PM,RD,FE,UE,UI,QA,OP,DBA,BRD,MRD, PRD,FSD等缩写的全称解析