Assignment012c

JavaScript Window Object - setTimeout()

As you know, JavaScript comes prebuilt with several objects for you to use. Let's use an additonal method for the window object. Let's play with window.setTimeout().

setTimeout() allows you to run code after a set number of milliseconds (1000 miliseconds = 1 second). In this example, JavaScript will open an alert box 5 seconds after arriving to this page.