HTMLBodyElement
The HTMLBodyElement interface provides special properties (beyond those inherited from the regular HTMLElement interface) for manipulating <body> elements.
Properties
Inherits properties from its parent, HTMLElement and from WindowEventHandlers.
-
HTMLBodyElement.aLink -
Is a
DOMStringthat represents the color of active hyperlinks. -
HTMLBodyElement.background -
Is a
DOMStringthat represents the description of the location of the background image resource. Note that this is not an URI, though some older version of some browsers do expect it. -
HTMLBodyElement.bgColor -
Is a
DOMStringthat represents the background color for the document. -
HTMLBodyElement.link -
Is a
DOMStringthat represents the color of unvisited links. -
HTMLBodyElement.text -
Is a
DOMStringthat represents the foreground color of text. -
HTMLBodyElement.vLink -
Is a
DOMStringthat represents the color of visited links.
Methods
No specific methods; inherits methods from its parent, HTMLElement, and from WindowEventHandlers.
Event handlers
No specific event handlers; inherits event handlers from its parent, HTMLElement and from WindowEventHandlers.
WindowEventHandlers.onafterprint-
Is an event handler representing the code to be called when the
afterprintevent is raised. WindowEventHandlers.onbeforeprint-
Is an event handler representing the code to be called when the
beforeprintevent is raised. WindowEventHandlers.onbeforeunload-
Is an event handler representing the code to be called when the
beforeunloadevent is raised. WindowEventHandlers.onhashchange-
Is an event handler representing the code to be called when the
hashchangeevent is raised. -
WindowEventHandlers.onlanguagechange -
Is an event handler representing the code to be called when the
languagechangeevent is raised. WindowEventHandlers.onmessage-
Is an event handler called whenever an object receives a
messageevent. WindowEventHandlers.onmessageerror-
Is an event handler called whenever an object receives a
messageerrorevent. WindowEventHandlers.onoffline-
Is an event handler representing the code to be called when the
offlineevent is raised. WindowEventHandlers.ononline-
Is an event handler representing the code to be called when the
onlineevent is raised. WindowEventHandlers.onpagehide-
Is an event handler representing the code to be called when the
pagehideevent is raised. WindowEventHandlers.onpageshow-
Is an event handler representing the code to be called when the
pageshowevent is raised. WindowEventHandlers.onpopstate-
Is an event handler representing the code to be called when the
popstateevent is raised. WindowEventHandlers.onrejectionhandled-
An event handler representing the code executed when the
rejectionhandledevent is raised, indicating that aPromisewas rejected and the rejection has been handled. GlobalEventHandlers.onresize-
Is an event handler representing the code to be called when the
resizeevent is raised. WindowEventHandlers.onstorage-
Is an event handler representing the code to be called when the
storageevent is raised. WindowEventHandlers.onunhandledrejection-
An event handler representing the code executed when the
unhandledrejectionevent is raised, indicating that aPromisewas rejected but the rejection was not handled. WindowEventHandlers.onunload-
Is an event handler representing the code to be called when the
unloadevent is raised.
Specifications
| Specification |
|---|
| HTML Standard (HTML) # htmlbodyelement |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
HTMLBodyElement |
1 |
12 |
1 |
4 |
≤12.1 |
3 |
1 |
18 |
4 |
≤12.1 |
1 |
1.0 |
aLink |
1 |
12 |
1 |
4 |
≤12.1 |
3 |
1 |
18 |
4 |
≤12.1 |
1 |
1.0 |
background |
1 |
12 |
1 |
4 |
≤12.1 |
3 |
1 |
18 |
4 |
≤12.1 |
1 |
1.0 |
bgColor |
1 |
12 |
1 |
4 |
≤12.1 |
3 |
1 |
18 |
4 |
≤12.1 |
1 |
1.0 |
link |
1 |
12 |
1 |
4 |
≤12.1 |
3 |
1 |
18 |
4 |
≤12.1 |
1 |
1.0 |
onorientationchange |
No |
No |
No |
No |
No |
No |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
text |
1 |
12 |
1 |
4 |
≤12.1 |
3 |
1 |
18 |
4 |
≤12.1 |
1 |
1.0 |
vLink |
1 |
12 |
1 |
4 |
≤12.1 |
3 |
1 |
18 |
4 |
≤12.1 |
1 |
1.0 |
See also
- HTML element implementing this interface:
<body> WindowEventHandlers
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement