大家好,又见面了,我是你们的朋友全栈君。
var count = 60 * 15;
var countdown = setInterval(CountDown, 1000);
function CountDown() {
if (count >= 0) {
var minutes = Math.floor(count / 60);
var seconds = Math.floor(count % 60);
var msg = "请等待" + minutes + "分" + seconds + "秒";
alert(msg)
--count;
} else {
clearInterval(countdown);
alert("倒计时结束")
}
}
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/129520.html原文链接:https://javaforall.cn