July 15, 2001 - The Virtual Root Node's Type
July 15, 2001|
The Virtual Root Node Type
Tips: July 2001
Yehuda Shiran, Ph.D.
documentobject. But this node is only virtual: you cannot prompt its type, name, or ID. You can access these properties through the
documentElementobject attribute. If you would query the name of
you would get
HTML. Try it. You may also query the root's type:
You should get
1. Try it. There are three types:
document.documentElement is the root of the document model. If you would query its first child:
you would get the
HEAD tag. Try it.
The code in this tip can be viewed by all DOM-supporting browsers such as IE 5+ and Netscape 6.