DEV Community

Joe Steinbring
Joe Steinbring

Posted on

How to implement a simple countdown timer in JavaScript

This is going to be a pretty quick little post. I was asked yesterday about how I would implement a countdown timer in just plain vanilla javascript. Here is my solution ...

You'll see that I am using setInterval() to recreate the countdown object once every 1 second. Once it is recreated, I am using document.getElementById().innerHTML to refresh the page.

Have any questions, comments, etc? Feel free to post a comment, below.

Top comments (0)