Home > Web Front-end > HTML Tutorial > What are the HTML tags that support the onload event?

What are the HTML tags that support the onload event?

青灯夜游
Release: 2023-01-04 09:38:24
Original
3507 people have browsed it

HTML tags that support onload events are: "body", "frame", "frameset", "iframe", "img", "", "link", "script", "style" ".

What are the HTML tags that support the onload event?

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};
Copy after login

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 .

Each in can set different properties, such as border, scrolling, noresize, etc.

Note: If you wish to validate pages containing frames, make sure is set to "HTML Frameset DTD" or "XHTML Frameset DTD".

tag defines a frameset.

The element is used to organize one or more elements. Each has its own separate document. The

element specifies how many columns or rows exist in the frameset, and the percentage/pixels occupied by each row and column.

Note: If you wish to validate pages containing frames, make sure is set to "HTML Frameset DTD" or "XHTML Frameset DTD". The