Notes

document.body is the element that contains the content for the document. In documents with <body> contents, returns the <body> element, and in frameset documents, this returns the outermost <frameset> element.

Though body is settable, setting a new body on a document will effectively remove all the current children of the existing <body> element.

Notes The body property was implemented on the HTMLDocument interface in Firefox for a long time, hence document.body would not return the <body> element if the document's Content-Type was not set to text/html or application/xhtml+xml (or if it came from DOMParser.parseFromString without the text/html type being used). This has been fixed in Firefox 60.

IEFull support
6

OperaFull support
9.6

SafariFull support
4

WebView AndroidFull support
Yes

Chrome AndroidFull support
Yes

Edge MobileFull support
Yes

Firefox AndroidFull support
Yes

Notes

Full support
Yes

Notes

Notes The body property was implemented on the HTMLDocument interface in Firefox for a long time, hence document.body would not return the <body> element if the document's Content-Type was not set to text/html or application/xhtml+xml (or if it came from DOMParser.parseFromString without the text/html type being used). This has been fixed in Firefox 60.