js 验证码 倒计时60秒
2016-02-01 12:02
555 查看
**js 验证码 倒计时60秒**
<input type="button" id="btn" value="免费获取验证码" /> <script type="text/javascript"> 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) } } document.getElementById("btn").onclick=function(){time(this);} </script>
相关文章推荐
- javascript实现右侧弹出“分享到”窗口效果
- 搜索过的问题集合(主要是Ext.js5)
- JSTL---JSP标准标签库技术
- js常用代码片段
- JSP与Servlet的介绍说明
- JSConsole调试
- 基于JavaScript实现动态添加删除表格的行
- highchart.js的使用
- commonJS — 自定义事件处理(for CustomEvent)
- commonJS — 事件处理(for Event)
- commonJS — 全局操作(for Window)
- commonJS — 字符串操作(for String)
- HTML5视频播放器VideoJS使用附【源码及示例】- 兼容IE
- commonJS — 数字操作(for Number)
- commonJS — 函数操作(for Function)
- commonJS — DOM操作(for DOM)
- commonJS — 通用方法(for COM)
- commonJS — 浏览器操作(for Browser)
- js数组和字符串去重复几种方法
- commonJS — 数组操作(for Array)