HTML onload Event Attribute
Example
Run a JavaScript script when the document has finished loading:
Try it »
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 usually used in the element to execute a specified script after the page is fully loaded (including images, scripts, CSS files, etc.).
Differences between HTML 4.01 and HTML5
None.
Syntax
<
element
onload="
script
">
HTML Event Attributes