Window setTimeout () method
Definition and Usage
setTimeout () method is used to evaluate the expression or function call after a specified number of milliseconds.
Tip: 1000 ms = 1 second.
grammar
setTimeout(code,millisec,lang)
参数 | 描述 |
---|---|
code | 必需。要调用的函数后要执行的 JavaScript 代码串。 |
millisec | 必需。在执行代码前需等待的毫秒数。 |
lang | 可选。脚本语言可以是:JScript | VBScript | JavaScript |
Browser Support
All major browsers support setTimeout () method.
Examples
More examples
Endless cycle timing - with a stop button
Create a time event is always through.
Window object