jQuery 发送验证码倒计时按钮 复制代码

<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="../scripts/jquery.js" type="text/javascript"></script>
<script>
$(function () {
var util = {
wait: 90,
hsTime: function (that) {
_this = $(this);
if (_this.wait == 0) {
$('#hsbtn').removeAttr("disabled").val('重发短信验证码');
_this.wait = 90;
} else {
var _this = this;
$(that).attr("disabled", true).val('在' + _this.wait + '秒后点此重发');
_this.wait--;
setTimeout(function () {
_this.hsTime(that);
}, 1000)
}
}
}
util.hsTime('#hsbtn');
$("#hsbtn").click(function(){
util.hsTime('#hsbtn');
})
})
</script>
</head>
<body>
<input type="button" id="hsbtn" />
</body>
</html>
上一篇:Java中Unicode的编码和实现


下一篇:(转)C#/.NET主线程与子线程之间的关系