January 12, 2001 - The document Object | WebReference

January 12, 2001 - The document Object

Yehuda Shiran January 12, 2001
The document Object
Tips: January 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

The Document Object Model (DOM) has several dualities. One of them is the document object vs. the documentElement object. Internet Explorer does not support the document object in the DOM. All object properties are undefined in this case. Netscape 6, on the other hand, does support both of these objects. To understand the difference between the document object and the documentElement object, look who their children are. The document object's first and last child is HTML. The documentElement object's first child, on the other hand, is HEAD, and its last child is BODY. The following buttons let you find out by yourself the value of these and other properties of the document object (right column) as well as those of the documentElement object (left column). We always return the node's name instead of its object, whenever applicable: