Skip to content Skip to sidebar Skip to footer

setTimeout method in javascript

     This method is used to call a specified function on specified time period. If you want to call a function after window load or after click a function or after any action, you can use setTimeout method.

Syntax
function expression

setTimeout(function(){},time);
or
function statement

setTimeout(callbackfunction,time);

time
1000 milliseconds = 1 seconds
10000 milliseconds=10 seconds
60000 milliseconds=1 minutes

Example

  setTimeout(function(){alert("called");},1000);



Example Program:- (Editor)


Editor is Loading...

Advertisement

Post a Comment for "setTimeout method in javascript"