Comments: This article mainly introduces the body Tag body element, which is the main content tag of the html document.
Configurable attributes
Onafterprint run the script after printing the document
Onbeforeprint run the script before the document is printed
Onbeforeonload run the script before the file is loaded
Onblur runs scripts when the window loses focus
Onerror: run the script when an error occurs.
Onfocus run the script when the window gets the focus
Onhaschange run the script when the document changes
Onload: run the script when the document is loaded
Onmessage
Onoffline run scripts when documents are offline
Ononline
Onpagehide runs scripts when the window is hidden
Onpageshow run the script when the window is visible
Onpopstate: run the script when the window history changes
Onredo: run the script when the document executes the redo operation.
Onresize run the script when the window size is adjusted
Onstorage
Onundo: run the script when the document executes the Undo operation.
Onunload run the script when the user leaves the document
DOM interface
Code: select all to run
Interface HTMLBodyElement: HTMLElement {
Attribute Function onafterprint;
Attribute Function onbeforeprint;
Attribute Function onbeforeunload;
Attribute Function onblur;
Attribute Function onerror;
Attribute Function onfocus;
Attribute Function onhashchange;
Attribute Function onload;
Attribute Function onmessage;
Attribute Function onoffline;
Attribute Function ononline;
Attribute Function onpopstate;
Attribute Function onpagehide;
Attribute Function onpageshow;
Attribute Function onredo;
Attribute Function onresize;
Attribute Function onscroll;
Attribute Function onstorage;
Attribute Function onundo;
Attribute Function onunload;
};