Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Image onload Event

Image onload Event

Image Object Reference Image Object


Definition and Usage

The onload event is executed immediately after the image finishes loading.

Syntax

onload="

JavaScriptCode

"

Parameters Description
JavaScriptCode Required. The JavaScript code executed after the event is triggered.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the onload event


Example

Example

Pop up "Image loaded" immediately after the image finishes loading:

Try it »


Image Object Reference Image Object