The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.
This article is Ready to Use.
The body element (<body>) represents the main content of the document.
You can access the
<body> element from script through the document object.
The window object for the
<body> element can host event handlers for the
HTML Event Handler Content Attributes
||User printed current document.|
||User requested printing of current document.|
||Document is about to be unloaded.|
||Document lost focus.|
||Document failed to load properly.|
||Document received focus.|
||Fragment identifier part of the document’s current address changed.|
||Document finished loading.|
||Document received a message.|
||Network connections failed.|
||Network connections returned.|
||User navigated session history.|
||User went forward in undo transaction history.|
||Document view was resized.|
||Storage area changed.|
||User went backward in undo transaction history.|
||Document is going away.|
The following attributes are obsolete, and should not be used by authors:
<body> element follows the
<head> element and is contained by the
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>The HTML Document</title> </head> <body> <p>The HTML content</p> </body> </html>
This example exposes the
var oBody = document.body;
|HTML 5.1||W3C Working Draft|
|HTML 5||W3C Recommendation|
|HTML 4.01||W3C Recommendation|
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]