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
对不起,我匆忙让我改变, –