December 2013
Intermediate to advanced
384 pages
9h 54m
English
function myTimer () { alert("Timer Function Executed"); } var timerId = setTimeout(myTimer, 10000);
To simply delay the execution of code for a certain amount of time, use the setTimeout(code, ms) method, where code is either a statement or a function that executes when the time expires. ms is the number of milliseconds. For example, to execute a function named myTimer() in 10 seconds, you would use the following:
setTimeout(myTimer, 10000);
Read now
Unlock full access