点击按钮出现60秒倒计时js代码
2016-10-13 11:34
363 查看
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="js/jquery.js"></script>
</head>
<body>
<input type="button" id="btn" value="免费获取验证码" onclick="settime(this)" />
<script type="text/javascript">
var countdown=60;
function settime(val) {
if (countdown == 0) {
val.removeAttribute("disabled");
val.value="免费获取验证码";
countdown = 60;
} else {
val.setAttribute("disabled", true);
val.value="重新发送(" + countdown + ")";
countdown--;
}
setTimeout(function() {
settime(val)
},1000)
}
</script>
</body>
</html>
相关文章推荐
- 点击按钮出现60秒倒计时js代码
- 点击按钮出现60秒倒计时的简单js代码(推荐)
- js代码实现点击按钮出现60秒倒计时
- 点击按钮出现60秒禁用倒计时js代码
- js代码实现点击按钮出现60秒倒计时
- 点击按钮出现5秒倒计时js代码
- 点击按钮出现60秒倒计时js代码
- [个人备份]js点击按钮进行60秒倒计时
- js jquery 按钮点击后 60秒之后才能点击 60秒倒计时
- jquery 实现点击按钮后出现倒计时效果(用于实现发送手机验证码、邮箱验证码)
- vue获取手机验证码60秒倒计时,不能点击按钮
- 点击按钮,实现60秒倒计时效果(发送手机验证码)
- 用户点击获取验证码之后我们会发送一条信息到用户手机,然后就会出现一个倒计时按钮,很像支付宝手机付款效果了,下面我给大家分享两个js效果
- asp.net中当点击按钮时出现找不到页面的解决方案
- Angular.js实现获取验证码倒计时60秒按钮的简单方法
- 关于点击jquery pagination分页按钮出现莫名跳转的解决办法
- js实现模拟自动点击按钮,并且在10秒倒计时之后疯狂点击
- 【android】:android积累2之如何实现点击一个按钮或者选项然后出现一条消息
- 去除点击按钮时出现的虚线框
- java点击按钮,出现另一个窗口