验证码 60秒后重新发送

//短信操作
var wait=60;
function time() {
    var code = document.getElementById(‘code_send‘);
    if (wait == 0) {
        code.removeAttribute("disabled");
        code.innerHTML="获取验证码";
        wait = 60;
    } else { // www.jbxue.com
        code.setAttribute("disabled", true);
        code.innerHTML="重新发送(" + wait + ")";
        wait--;
        setTimeout(function() {
            time()
        },
        1000)
    }
}
时间: 2024-08-14 18:56:05

验证码 60秒后重新发送的相关文章

Hbuilder MUI 注册短信验证60秒后重新发送

<div class="mui-input-row"> <label class="iconfont_log_reg icon-youjian"></label> <input type="text"  placeholder="请输入短信验证码" id="u_code"> <a href="javascript:senmobile(60);&

JS 60秒后重发送验证码

//settime($("#getPhoneCode"),60); function settime($obj, time) { if (time == 0) { $obj.attr("disabled", false); $obj.css("background", "#f38401").css("cursor", "pointer"); $obj.text("获取手机验证码

验证码60秒倒计时

验证码60秒倒计时(jQuery), 代码如下: //验证码倒计时 var countdown = 60; var st; function settime(element) { if (countdown != 0) { st = setTimeout(function () { settime(element); }, 1000); } if (countdown == 0) { element.removeAttr("disabled"); element.val("获

初级(低版本)60秒后重试

今天早上的,学习的第一个代码是80%是自己写的,当然和demo是有出入的,有的地方demo比我好,我也解决了demo中的一个bug,这一点还是比较欣慰的. 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http

用JavaScript写一个简单的倒计时,可以应用在发送短信验证码的“59秒后重新发送验证短信”

倒计时——从10倒数到0,点击按钮会还原倒计时 <body> <!-- 将textvalue值设为10,从10倒数 --> <input type="text" value="10" id="txt"> <input type="button" value="重新开始" id="btn"> </body> <script&

js jquery 按钮点击后 60秒之后才能点击 60秒倒计时

var wait = 60; function time(o) { if (wait == 0) { $(o).attr("disabled", false); $(o).val("获取验证码"); wait = 60; } else { $(o).attr("disabled", true); o.val(wait + "秒后重新发送"); wait--; setTimeout(function () {time(o);},

js实现60秒倒计时效果(使用了jQuery)

今天碰到要实现一个类似那种短信验证码60秒倒计时的需求,好久不写js,有点手生.把代码记录下,方便后续查阅. 这里我用了jQuey,毕竟写起来简洁点.下面直接看效果和代码. 一.效果 二.代码 (1)html <input type="button" id="btn" value="免费获取验证码" onclick="daojishi(10,this)" /> 注意:要引入JQuery (2)js <scri

ios 简单的倒计时验证码数秒过程实现

timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerFireMethod:) userInfo:nil repeats:YES]; //倒计时方法验证码实现倒计时60秒,60秒后按钮变换开始的样子 -(void)timerFireMethod:(NSTimer *)theTimer { if (seconds == 1) { [theTimer invalidate]; s

Jquery插件 防刷新倒计时 “点击获取验证码后60秒内禁止重新获取

Jquery插件实现"点击获取验证码后60秒内禁止重新获取(防刷新)" 效果图: 先到官网(http://plugins.jQuery.com/cookie/)下载cookie插件,放到相应文件夹,代码如下: 1 <style type="text/css"> 2 * {margin: 0; 3 padding: 0; 4 font-family: "Microsoft Yahei"; 5 } 6 .captcha-box { 7 w