//倒计时
var countdown=60;
function settime(val) {
if (countdown == 0) {
val.removeAttribute("disabled");
val.value="重新获取";
countdown = 60;
return false;
} else {
val.setAttribute("disabled", true);
val.value="还剩" + countdown + "s";
countdown--;
}
setTimeout(function() {
settime(val);
},1000);
}
最后写上点击的位置 οnclick="settime(this)"