<div class="forgetTxt">
<input class="txtInput code fl" type="text" placeholder="请输入手机验证码" />
<input class="getCode fr" type="button" value="获取验证码" />
</div>
<script>
// 获取验证码var wait=60;
function time(o) {
if (wait == 0) {
o.removeAttr("disabled");
o.val("重新获取");
o.css('color','#fff');
o.css('background','#e27719');
wait = 60;
} else {
o.attr("disabled", true);
o.val(wait + "秒后重新获取");
o.css('color','#eee') ;
o.css('background','#ccc');
wait--;
setTimeout(function() {
time(o)
},
1000)
}
}
// 注册页面获取验证码
$('.getCode').on('click',function () {
time($(this));
});
</script>