表单用form写会刷新,若form不写method和action的属性但是结构内有button按钮也会刷新!!!
function Settime(obt) {
var countdown = 60;
settime(obt);
function settime(obt) {
if (countdown == 0) {
$(obt).attr("disabled", false);
$(obt).text("获取验证码");
countdown = 60;
return;
} else {
$(obt).attr("disabled", true);
$(obt).html("(" + countdown + ")s" + "<br/>" + "重新发送");
countdown--;
}
setTimeout(function() {
settime(obt)
}, 1000)
}
};
$("#backTime").click(function() {
Settime("#backTime");
//$(this).css("line-height", "20px");
});