Javascript: / Home / DOM

Document Object Model

The Document Object Model is often just called the "DOM".

Javascript cannot use the HTML Document file text directly. Instead it uses DOM objects.

When an HTML page is first loaded into the browser; it creates a programmable object tree from the HTML file text. This is a structure of DOM objects that represent the HTML Document.

A DOM "Object"" can contain other DOM objects just like HTML elements can contain other HTML elements.

A DOM object can contain "Methods". These methods are blocks of code that have a unique name. The code in the method can be executed by using the method name. This is referred to as "Calling" the method or a method "Call". A method is called with parentheses as in MethodName().

A DOM object can contain "Properties" and property values similar to an HTML element attribute.

The methods and properties of an object are called "members". This is because they belong to the object and can only be used by first specifying the object name, then a dot "." and then the contained member name. As in the object: window.location.

<- Javascript            DOMObjects ->
2DOM