Answers for "Create A Counter Using SetTimeout In JavaScript ?"

0

Create A Counter Using SetTimeout In JavaScript ?

//JAVASCRIPT
   var count = 0;
   function counter() {
       document.getElementById("counter").innerHTML = count;
       count = count + 1;      
       setTimeout(counter, 1000) 
   }
   counter();

   //HTML
   Counter <span id="counter"> 0 </span>
Posted by: Guest on September-28-2021

Code answers related to "Create A Counter Using SetTimeout In JavaScript ?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language