mozilla
Your Search Results

    HTMLBodyElement

    The HTMLBodyElement interface provides special properties (beyond those of the regular HTMLElement interface they also inherit) for manipulating body elements.

    Properties

    Inherits properties from its parent, HTMLElement and from WindowEventHandlers.

    HTMLBodyElement.aLink
    Is a DOMString that represents the color of active hyperlinks.
    HTMLBodyElement.background
    Is a DOMString that 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 DOMString that represents the background color for the document.
    HTMLBodyElement.link
    Is a DOMString that represents the color of unvisited links.
    HTMLBodyElement.text
    Is a DOMString that represents the foreground color of text.
    HTMLBodyElement.vLink
    Is a DOMString that represents the color of visited links.

    Methods

    No specific method; inherits methods from its parent, HTMLElement and from WindowEventHandlers.

    Event handlers

    No specific event handler; inherits event handlers from its parent, HTMLElement and from WindowEventHandlers.

    WindowEventHandlers.onafterprint
    Is an EventHandler representing the code to be called when the afterprint event is raised.
    WindowEventHandlers.onbeforeprint
    Is an EventHandler representing the code to be called when the beforeprint event is raised.
    WindowEventHandlers.onbeforeunload
    Is an EventHandler representing the code to be called when the beforeunload event is raised.
    WindowEventHandlers.onhashchange
    Is an EventHandler representing the code to be called when the hashchange event is raised.
    WindowEventHandlers.onlanguagechange
    Is an EventHandler representing the code to be called when the languagechange event is raised.
    WindowEventHandlers.onmessage
    Is an EventHandler representing the code to be called when the message event is raised.
    WindowEventHandlers.onoffline
    Is an EventHandler representing the code to be called when the offline event is raised.
    WindowEventHandlers.ononline
    Is an EventHandler representing the code to be called when the online event is raised.
    WindowEventHandlers.onpagehide
    Is an EventHandler representing the code to be called when the pagehide event is raised.
    WindowEventHandlers.onpageshow
    Is an EventHandler representing the code to be called when the pageshow event is raised.
    WindowEventHandlers.onpopstate
    Is an EventHandler representing the code to be called when the popstate event is raised.
    WindowEventHandlers.onresize
    Is an EventHandler representing the code to be called when the resize event is raised.
    WindowEventHandlers.onstorage
    Is an EventHandler representing the code to be called when the storage event is raised.
    WindowEventHandlers.onunload
    Is an EventHandler representing the code to be called when the unload event is raised.

    Specifications

    Specification Status Comment
    WHATWG HTML Living Standard
    The definition of 'HTMLBodyElement' in that specification.
    Living Standard Technically, the event-related properties,onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload, have been moving to WindowEventHandlers, and HTMLBodyElement implements this interface.
    HTML5.1
    The definition of 'HTMLBodyElement' in that specification.
    Working Draft  
    HTML5
    The definition of 'HTMLBodyElement' in that specification.
    Recommendation The following properties are now obsolete: aLink, bgColor, background, link, text, and vLink.
    The following properties have been added: onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload.
    Document Object Model (DOM) Level 2 HTML Specification
    The definition of 'HTMLBodyElement' in that specification.
    Recommendation No change from Document Object Model (DOM) Level 1 Specification.
    Document Object Model (DOM) Level 1 Specification
    The definition of 'HTMLBodyElement' in that specification.
    Recommendation Initial definition.

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
    Basic support 1.0 1.0 (1.7 or earlier) [1] 4.0 (Yes) [1] (Yes)
    onXYZ event handlers (Yes) (Yes) ? ? ?
    onlanguage ? 32 (32) ? ? ?
    Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
    Basic support (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)
    onXYZ event handlers (Yes) (Yes) ? ? ?
    onlangugage ? 32.0 (32) ? ? ?

    [1] Firefox prior to Firefox 7.0 and some older versions of Opera did returned an URI for the HTMLBodyElement.background attribute.

    See also

    • HTML element implementing this interface: <body>

    Document Tags and Contributors

    Contributors to this page: Sheppy, Nexii, Rob W, fscholz, mua, Ehsan, imsaikat, jswisher, trevorh, kscarfone, teoli, Ms2ger
    Last updated by: fscholz,
    Hide Sidebar