Comment: This article mainly introduces the body tag
The body element is the main content tag of the html document.Properties can be set
onafterprint Run the script after printing the document
onbeforeprint Run the script before the document is printed
onbeforeonload Run the script before the document is loaded
onblur Run script when the window loses focus
oneerror Run the script when an error occurs
onfocus Run the script when the window gets focus
onhaschange Run the script when the document changes
onload Run the script when the document is loading
onmessage Run the script when a message is triggered
onoffline Run scripts when the document is offline
ononline Run the script when the document is online
onpagehide Run the script 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 performs re-execution operation (redo)
onresize Run the script when resizes the window
onstorage Run the script when the document is loaded
onundo Runs the script when the document performs an 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 oneerror;
attribute Function onfocus;
attribute Function onhashchange;
attribute Function onload;
attribute Function onmessage;
attribute Function onoffline;
attribute Function online;
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;
};