Advertisement
Home Open Editor ❯

HTML onload event 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">


Advertisement

Attribute Values

Value Description
script Specifies the script to be run on onload

Technical Details

Supported HTML elements:

<body>, <frame>, <frameset>, <iframe>, <img>, <input type="image">, <link>, <script> and <style>
Home Open Editor ❯
Advertisement