javascriptclearInterval

 function f1(){

 count=20;
    setInterval(
        function(){
            document.getElementById('c').innerText=count;
            
            if(count>0){
                count--;
            }
            else{

                document.getElementById('a').innerHTML=`<h1>
                End Sale</h1>`;
                clearInterval(this);
                
            }
        }
            ,1000
        )
}

Comments

Popular posts from this blog

interview questions js[ Anurag Singh ProCodrr]

reactnative_creation