Properties of the document object

The table below lists the properties of the document object with a short description of each property. Not all properties are cross-browser and some of them have been deprecated.

PropertyDescription
activeElementReturns a string holding the value of the active delement in the document.
alinkColorReturns the hexadecimal value of the active link color of the document.
anchorsAn array of all the named anchors in the document.
asyncTells the browser whether to load a document with an asyncronous request or a synchronous request.
appletsAn array of all the Java applets in a document.
bgColorReturns the hexadecimal value of the becground color of the document.
bodyReturns the body or the frameset element of the document.
characterSetReturns a string value that represents the character set used to encode the document.
charsetReturns a string value that represents the character set used to encode the document.
childNodesAn array of all the child nodes of the document.
compatModeReturns the string “BackCompat” if the document is rendered in Quirks mode or the string “CSS1Compat” if the document is rendered in Strict Mode.
contentTypeReturns a string for the Content-Type from the MIME header of the document.
cookieUsed to set JavaScript cookies in a document.
defaultCharsetReturns a string value that represents the default character set used to encode the document.
defaultViewReferences the window object for the document.
designModeReturns a string value that provides information on whether or not the document can be edited.
dirReturns a string value that represents the reading direction of the document.
doctypeReturns the doctype declaration associated with the document.
documentElementReturns a string that represents the root node of the document.
documentURIObjectReturns an object that represents the URI of the document (alvailable only to privilege JavaScript code).
domainReturns the domain name of the server for the document.
embedsAn array of all the embed tags in the document.
expandoReturns a boolean value based on whether or not arbitrary variables can be created within the document.
fgColorReturns the hexadecimal value of the default text color of the document.
fileCreatedDateReturns the date the document was created.
fileModifiedDateReturns the date the document was last modified.
formNameCreates a new property with each named form placed in the document.
formsAn array of all form tags in a document.
framesAn array of all the frames used in a document.
heightReturns the height in pixels of the body element of the document.
imagesReturns an array of all the image tags in the document.
implementationReturns a string value representing the implementation object of the document.
inputEncodingReturns a string that represents the document’s encoding.
lastModifiedReturns the date of the last modification of the document.
layersAn array of all the layer tags on the page (Netscape Navigator 4 only).
allAllows access of all the objects on a page.
linkColorReturns the hexadecimal value of the default link color for the document.
linksAn array of all the link tags in the document.
locationReturns the URI of the document.
namespacesAn array of all the namespaces in the document.
parentWindowReturns a referance to the parent window (the parent window’s document object).
pluginsAn array of all the plugins used in the document.
protocolReturns the protocol portion of the web address (URL) of the document.
readyStateReturns a string value that represents the current state of the document.
referrerReturns the URL of the document that reffered the viewer to the current document.
scriptsAn array of all the script tags used in the document.
styleSheetsAn array of all the style sheets used in the document.
tagsSets the style of an HTML tag in the document.
titleReturns the text used inside the title tag of the document.
uniqueIDReturns a string value that represents a unique ID given to the document.
URLReturns the URL of the current document.
URLUnencodedReturns the URL of the document without any encoding.
vlinkColorReturns the hexadecimal value of the visited link color for the document.
widthReturns the width, in pixels, of the body element of the document.

Leave a Reply