var count = 10;
function countdown() {
count--;
$("#count").text(count);
console.log(count);
countComplete();
}
function countComplete() {
if (count <= 0) {
document.getElementById("count").innerHTML="done";
}
}
答案 0 :(得分:2)
基本上,您只需减少每次点击的计数器,如果计数器变为0,则更改按钮文字并将其禁用。
o.method = (function(original) {
return function(x, y) {
var a = 'A';
var b = 'B';
var result = original.apply(this, [a, b]);
return result;
}
})();
o.method(1, 2);