Easy Tutorial
❮ Att Link Hreflang Att Input Checked ❯

HTML onload Event Attribute

HTML Event Attributes

Example

Run JavaScript code after the document has finished loading:


Browser Support

All major browsers support the onload event attribute.


Definition and Usage

The onload attribute is triggered after the document object has finished loading.

onload is commonly used in the <body> element to execute specified scripts after the page has fully loaded (including images, scripts, CSS files, etc.).


Differences Between HTML 4.01 and HTML5

None.


Syntax

Attribute Values

Value Description
script Specifies the script to be executed when the onload event is triggered.

❮ Att Link Hreflang Att Input Checked ❯