Definition and Usage
The setInterval() method calls a function or evaluates an expression at specified intervals (in milliseconds).The setInterval() method will continue calling the function until clearInterval() is called, or the window is closed.
The ID value returned by setInterval() is used as the parameter for the clearInterval() method.
Tip: 1000 ms = 1 second.
Syntax
setInterval(code,millisec,lang)
Parameter | Description |
---|---|
code | Required. The function that will be executed |
millisec | Required. The intervals (in milliseconds) on how often to execute the code |
lang | Optional. JScript | VBScript | JavaScript |
Browser Support
The setInterval() method is supported in all major browsers.
No comments:
Post a Comment