Timer Events Demo : Timer « Development « JavaScript DHTML






Timer Events Demo

/* JavaScript Unleashed, Third Edition by Richard Wagner and R. Allen Wyke ISBN: 067231763X Publisher Sams CopyRight 2000 */ <head> <script language="JavaScript"> <!-- function dailyTask() { var tdy = new Date(); if ((tdy.getHours() == 8) && (tdy.getMinutes() == 30)) { alert('Good morning sunshine!') clearInterval(timerID) } } //-->  timerID = setInterval('dailyTask()', 10000) </script> </head> 








Related examples in the same category

1.Using a Timer
2.setInterval() and clearInterval() methods
3.A Countdown Timer
4.Timer Events Demo 2
5.Accessing Document Contents
6.A Timeout Processing Example
close