表单按钮倒计时 》验证码 jQuery&&JavaScript
来源:互联网 发布:全国所有中小学数据库 编辑:程序博客网 时间:2024/06/06 03:54
<script src="jquery-2.1.4.min.js"></script>
<input type="button" id="btn" value="免费获取验证码" />
//jquery代码
<script type="text/javascript">
//jquery代码
$("#btn").click(function(){
time(this)
})
var wait=60;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value="免费获取验证码";
wait = 60;
} else {
o.setAttribute("disabled", true);
o.value="重新发送(" + wait + ")";
wait--;
setTimeout(function() {
time(o)
},
1000)
}
}
})
////////////////////////////////////////////////////////////////////////////////////////////
//js原生
// document.getElementById("btn").onclick=function(){
// time(this);
// }
// var wait=60;
// function time(o) {
// if (wait == 0) {
// o.removeAttribute("disabled");
// o.value="免费获取验证码";
// wait = 60;
// } else {
// o.setAttribute("disabled", true);
// o.value="重新发送(" + wait + ")";
// wait--;
// setTimeout(function() {
// time(o)
// },
// 1000)
// }
// }
</script>
1 0
- 表单按钮倒计时 》验证码 jQuery&&JavaScript
- js/jquery倒计时发送验证码按钮
- jquery 实现验证码倒计时 点击按钮后倒计时效果
- 验证码倒计时按钮
- iOS - 验证码,倒计时按钮
- jquery设置验证码倒计时
- jquery 手机号验证码倒计时
- 使用图片按钮调用Javascript验证表单
- js倒计时发送验证码按钮
- 单击按钮发送验证码,出现倒计时
- Android发送验证码的倒计时按钮
- 模拟 短信验证码 按钮倒计时
- 短信验证码按钮60秒倒计时
- 点击按钮获取验证码,倒计时。
- android倒计时获取验证码按钮
- Android 获取验证码 倒计时按钮
- JQuery按钮倒计时
- jquery 实现 点击按钮后倒计时效果,多用于实现发送手机验证码、邮箱验证码
- 路由器的串口(serial)和以太口的区别
- 微信小程序开发教程(基础篇)5-index 页面解析
- shiro 配置首先访问地址
- HashMap和HashTable的选择
- Ubuntu中安装JDK
- 表单按钮倒计时 》验证码 jQuery&&JavaScript
- cardboard的使用
- 使用ngrok实现内网穿透
- 关于python中@property的使用
- 浅析JavaScript的原型(prototype)(一)
- 合理使用nginxhash策略做更有意义的负载均衡
- linux下安装录制视频软件Simple Screen Recorder
- 《自控力》书摘
- LeetCode 21. Merge Two Sorted Lists