JavaScript Event ClearTimeout
View Source...
Within JavaScript, it is possible to execute some code NOT immediately after a function is called, but after a specified time interval, in this case 30 seconds. Something is done (or scheduled) when the timeout is reached. In our demo, an event is planned to happen after 30 seconds (0 through 29). You can click on start, let it run fully or terminate it early. Messages will appear in either case. Terminating a planned timed event prior to timeout is done with ClearTimeout. If terminated early, you CAN pick up where the event timer was stopped. View the source code; notes within.