Treehouse Quick Tips
Treehouse Quick Tips
Treehouse
Create a Timer in JavaScript
4 minutes Posted Jan 29, 2013 at 7:44 pm.
0:00
4:29
Download MP3
Show notes
Sometimes you need to wait a certain amount of time in your program before taking an action. You may also want to repeat an action after a certain length of time.
You can do this using a timeOut and an interval.
In this example tutorial, the element is replaced using getElementById.