/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <p id="foo" style="font-size: 15em; font-weight: bold; margin-top: 0px; text-align: center;"> 1 </p> <script> // Go... var e = document.getElementById("foo"); // Set the interval setInterval(function () { // Increment e.innerHTML -= -1; return; }, 100, e); // Make sure to pass the element along with the function. // A value of 0 for the timeout will make the browser go as fast as it can. (NOT RECOMMENDED) </script> </body> </html>