<input type="button" id="btn" value="点击我" />
$(function () {
$('#btn').click(function () {
var count = 10;
var countdown = setInterval(CountDown, 500);
function CountDown() {
$("#btn").attr("disabled", true);
$("#btn").val("Please wait " + count + " seconds!");
if (count == 0) {
$("#btn").val("点击我").removeAttr("disabled");
clearInterval(countdown);
}
count--;
}
})
});
欢迎光临 源于生活 (http://bbs.vingoo.info/) | Powered by Discuz! X3.1 |