Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Body onload Event

Body onload Event

Body Object Reference Body object


Definition and Usage

The onload event is triggered immediately after the page finishes loading.

Syntax

onload="

JavaScriptCode

"

Parameters Description
JavaScriptCode Required. Specifies the JavaScript to be executed when the event occurs.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the onload event


Example

Example

In this example, the text "Page is loaded" is displayed in the status bar:

Runoob Tutorial(runoob.com)

Hello World!

Try it »


Body Object Reference Body object