Hierarchy of objects (Definition)

To fully understand JavaScript and in particular its use in the browser, it is helpful to know how objects relate to one another.

In the core JavaScript language, objects are related to one another by means of the prototype chain. This is a hierarchy that determines the inheritance of functionality from a super-class, although it's an object-based inheritance and not really a class based inheritance. You can only walk up this hierarchy. There is no convenient way to determine what objects are sub-classed from an object.

From version 5.0 of MSIE and version 6.0 of Netscape, there are several hierarchy models available for traversing the document. The HTML view of the document is not quite the same as the DOM view. In general, each one is based on a property to traverse up the tree to a parent and collections for traversing down the tree to the leaf nodes. Here are some examples of the different hierarchical arrangements.

The DOM level 2 standard adds a suite of traversal methods for walking through a document object model. It is embodied in the following classes:

Related to the traversal suite, the DOM level 2 standard also introduces the Range suite. This is embodied in these classes:

See also:Arguments.caller, ChildNodes object, DIV object, Document.createTextNode(), Element.all[], Element.childNodes[], Element.children[], Element.offsetParent, Element.ownerDocument, Element.parentElement, Element.parentNode, Element.parentTextEdit, Layer.siblingAbove, Prototype Based Inheritance, rule.parentStyleSheet, StyleSheet.addImport(), StyleSheet.addRule(), StyleSheet.owningElement, StyleSheet.owningNode, StyleSheet.parentStyleSheet