HTML onload Attribute
HTML onload Attribute
The onload attribute fires when an object has been loaded. It is used with a body tag to execute the script once a page is loaded with all of its content.
It is also used to check the visitor's browser type and version in order to load the proper web page based on the information.
Used With:-
Elements | Event |
---|---|
body | onload |
iframe | onload |
img | onload |
input | onload |
link | onload |
script | onload |
style | onload |
Syntax:-
Its syntax is:- < element onload="your_script" >