|
July 15, 2001 The Virtual Root Node Type Tips: July 2001
Yehuda Shiran, Ph.D.
|
|
You can use the DOM (Document Object Model) to model the whole document. At the root of document model is the document object. But this node is only virtual: you cannot prompt its type, name, or ID. You can access these properties through the documentElement object attribute. If you would query the name of document.documentElement:
you would get
You should get
The node
you would get the The code in this tip can be viewed by all DOM-supporting browsers such as IE 5+ and Netscape 6. Learn more about the DOM in Columns 40, The DOM, Part I: Analysis, through Column 47, A DOM-Based Snakes Game, Part II.
People who read this tip also read these tips: Look for similar tips by subject: |