References

Collection of references for web development.

HTML body tag

Description

The HTML <body> element contains the content for the HTML document.

Attributes

Attribute Value Description
onafterprint script Execute JavaScript code after the user has printed the document.
onbeforeprint script Execute JavaScript code before the user has printed the document.
onbeforeunload script Execute JavaScript code before the document is unloaded.
onblur script Execute JavaScript code when the document has lost focus.
onerror script Execute JavaScript code when the document fails to load.
onfocus script Execute JavaScript code when the document receives focus.
onhashchange script Execute JavaScript code when the documents URL hash tag text has changed.
onload script Execute JavaScript code when the document has finished loading.
onmessage script Execute JavaScript code when the document receives a message.
onoffline script Execute JavaScript code when the network is offline.
ononline script Execute JavaScript code when the network is online.
onpopstate script Execute JavaScript code when the user navigates the session history.
onredo script Execute JavaScript code when the user needs to redo.
onresize script Execute JavaScript code when the user resizes the document.
onstorage script Execute JavaScript code when the storage has been changed.
onundo script Execute JavaScript code when the user needs to undo.
onunload script Execute JavaScript code when the document has been unloaded.

Example

<html>
	<head>
		<title>Website Title</title>
	</head>
	<body>
		<p>Hello World!</p>
	</body>
</html>

More Examples