HTML onload Event Attribute (original) (raw)

Last Updated : 21 Dec, 2023

**The onload event attribute works when an object has been loaded. This attribute is mostly used within the element to execute a script. It can be used with other elements as well. This attribute is used to check the visitor's browser type and browser version and load the proper version of the web page based on the information.

In simple words, It activates when a webpage or an element has finished loading and is also essential for executing scripts or functions once the content is fully rendered. It is commonly used to initialize interactive features, fetch data, or manipulate the DOM.

**Syntax:

**Supported Tags: