Javascript - Document variable (DOM)

> (World Wide) Web - (W3|WWW) > Javascript (Js|ECMAScript) > Javascript - 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
Advertising

3 - Example

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

web/javascript/browser/document.txt · Last modified: 2019/02/16 17:40 by gerardnico