0
這裏是鏈接到我的代碼http://codepen.io/meow414/pen/adLoEY請看看。sec = 0時sec變量不顯示0,它在sec == 0但在遞減後不顯示0,如何顯示它。爲什麼零在輸出遞減後沒有顯示?它是超時程序
var min = 0;
var sec = 3;
var over;
function xyz() {
document.getElementById("abc").innerHTML = min + ":" + sec;
sec--; //it is getting decremeted upto 0,that's why below while loop is running bu in output zero is not shown for ex 3 after decrementing will show like 3 then 2 then 1 then it will chnage to 9.
while(sec == 0) {
sec = 9;
}
}
$("#start").click(function() {
over=setInterval(xyz, 1000);
});
$("#pause").click(function() {
clearInterval(over);
});
$("#reset").click(function() {
min = 0;
sec = 5;
clearInterval(over);
document.getElementById("abc").innerHTML = min + ":" + sec;
});
請重新表述您的問題 - 目前還不清楚發生了什麼。此外,改變你的標題,所以它不那麼長(你不需要在標題中發佈整個問題) – AMACB
對不起,我匆忙讓我改變, –