JavaScript Kit > DOM Reference > Here
DOM Document Object properties
Document Object properties
Properties | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
body | References the body element of the page. From there, you can then access other nodes contained within the body. | ||||||||
body.offsetWidth, body.offsetHeight | Returns the width and height of the entire document, respectively. | ||||||||
compatMode | Returns the compatibility mode of the current
document, specifically, whether the page is rendered in Quirks or
Stricts mode. The two possible values returned are "BackCompat " for
Quirks and "CSS1Compat " for Strict. Useful for determining the
doctype
setting of the page and executing different code accordingly.Example(s): if (document.compatMode=="CSS1Compat") |
||||||||
document.documentMode IE8 only property |
IE8 property that detects the document mode used by
the browser to render the current page. Because IE8 can render a
page in various different modes depending on the page's doctype plus
the presence of certain HTML elements, documentMode
returns a different number depending on the mode the page is being
rendered in. They are
Microsoft recommends you use |
||||||||
doctype | Read-only property that returns the Document Type Definition (DTD) of the current document, or null if the page doesn't contain a DTD. Not supported in IE as of IE6. | ||||||||
documentElement | References the root element of the document, in the
case of HTML documents, the html element. This read only property is
useful for accessing all elements on the page, such as the HEAD. Example(s): entiredoc = document.documentElement; |
||||||||
domain | Gets/sets the domain of the current document. Useful
in cross domain scripting when one domain is to communicate with
another. Example(s): document.domain="javascriptkit.com" |
||||||||
implementation | Returns the DOM implementation of the current document. | ||||||||
ownerDocument | Returns a reference to the document object that
contains the current element/node. var ownerdoc=document.getElementById("adiv").ownerDocument |
||||||||
readyState IE property. Supported in Opera 9+, Chrome, and FF 3.6+ as well. |
Returns the loading
status of the document. It returns one of the below 4 values:
Use the o document.onreadystatechange=function(){ |
||||||||
styleSheets[] | An array referencing all stylesheet objects on the page, whether they are defined using the <style> or <link> tag. | ||||||||
title | Specifies the title of the document. Read/write in modern browsers. | ||||||||
URL | A string that specifies the complete URL of the document. |
Note: See also JavaScript document object.
DD CSS Library
Free CSS menus and codes to give your site a visual boost.