Advertisement
Home Open Editor ❯

HTML onload Attribute

Example

<body onload="myFunction()">

Try this code ❯

Meaning

The onload attribute specifies the event of a window, image, link, script or frame set finishing the loading of a document.


Standard Syntax

<element onload="script">


Applies to:

The onload attribute can be used on the following element:


Advertisement

Attribute Values

Value Description
script Specifies the script to be run on onload
Home Open Editor ❯
Advertisement