HTML tags that support onload events are: "body", "frame", "frameset", "iframe", "img", "", "link", "script", "style" ".
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
Recommended: html tutorial
onload event
onload event will occur when the page or image is loaded Occurs immediately upon completion. onload is usually used for the
element to execute script code after the page is completely loaded (including images, css files, etc.).Syntax
//在 HTML 中: <body onload="SomeJavaScriptCode"> //在 JavaScript 中: window.onload=function(){SomeJavaScriptCode};
Parameters:
SomeJavaScriptCode: Required. Specifies the JavaScript to be executed when this event occurs.
HTML tags that support onload events
##
Tags define the body of the document. The element contains all the content of the document (such as text, hyperlinks, images, tables, lists, etc.).tag defines the child window (frame) in