files/en-us/web/api/htmlbodyelement/index.md
{{APIRef("HTML DOM")}}
The HTMLBodyElement interface provides special properties (beyond those inherited from the regular {{ domxref("HTMLElement") }} interface) for manipulating {{HtmlElement("body")}} elements.
{{InheritanceDiagram}}
Inherits properties from its parent, {{domxref("HTMLElement")}}.
No specific methods; inherits methods from its parent, {{domxref("HTMLElement")}}.
The {{domxref("HTMLElement")}} events are inherited.
The following {{domxref("Window")}} onXYZ event handler properties are also available as aliases targeting the window object. However, it is advised to listen to them on the window object directly rather than on HTMLBodyElement.
[!NOTE] Using
addEventListener()onHTMLBodyElementwill not work for theonXYZevent handlers listed below. Listen to the events on the {{domxref("window")}} object instead.
# symbol).Window.postMessage() from another browsing context.false.true.localStorage) has been modified in the context of another document.Note that while onblur, onerror, onfocus, onload, onresize, and onscroll are available on any element, their meanings on the <body> element are not the same as on other elements. They listen for events on the window object instead.
{{Specifications}}
{{Compat}}