Browser - Document variable (DOM) - Javascript

> (World Wide) Web - (W3|WWW) > Web - Browser

1 - About

The document variable exists as a global variable and is provided by the browser (Not by the Javascript engine)

It represents the DOM document. Ie an interface to HTML document manipulation.

The DOM is a special object, often called a host object

The document variable is:

  • is a property of the window object
  • accessible globally through an alias

3 - Example

type = document.contentType;
console.log("The document type is "+type);