您的位置:首页 > Web前端 > JQuery

java-jquery(60秒发送短信验证码)源代码

2012-10-25 14:59 239 查看
<a id="color_sel" href="javascript:void(0);" class="public_b green_b"><i><input id="get_mobile_code_but" type="button" value="获取验证码" /></i></a>

<script>

var _time = 60;

function timedown( t ){

if( _time == 0 ){

t.removeAttribute("disabled");

t.value="免费获取验证码";

_time = 60;

}else {

t.setAttribute("disabled", true);

t.value=""+_time+"秒后再次获取";

_time--;

setTimeout(function() {

timedown(t)

},1000);

}

}

$(function(){

timedown(this);

});

</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: