(() => {
window.addEventListener("DOMContentLoaded",()=>
msgArea = document.getElementById("time");)
function CountDown(){
var count = 4, tmID, infobox =document.getElementById("timeout");
function countdown(){
if(--count == 0){
msgArea.innerText = "bon";
}else {
msgArea.innerText = count + "秒前";
tmID = setTimeout(countdown, 1000);
}
}
function startcountdown() {
tmID = setTimeout(countdown,1000);
infobox.removeEventListener("click",startcountdown, false);
}
infobox.addEventListener("click",startcountdown,false);
}
document.addEventListener("DOMContentLoaded",CountDown, false);
})();