Body onload Event
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





All major browsers support the onload event
Example
Example
In this example, the text "Page is loaded" is displayed in the status bar:
Hello World!
Try it »
Body object