function timer_start(){ var time= setInterval(()=>{ var x=document.getElementById('timer').innerHTML; document.getElementById('timer').innerHTML=(parseInt(x)-1); if(parseInt(x)==1){ console.log("merhabalar"); clearInterval(time); window.location.assign("/"); } },1000) }