DOM Level 0
The DOM level 0 is a mix of HTML functions that have not been formally specified that allow scripting languages to interact with Microsoft Internet Explorer 3.0 and Netscape Navigator 3.0. This basically means that if a DHTML page is compliant with DOM level 0 it should work reliably even in fairly old browsers.
The base structure of the DOM level 0 is the document master container. This refers to the entire document, and all elements within it. It is referenced as:
Because the DOM level 0 is very basic, it only allows the developer to manipulate items on the page that already have some level of interactivity, i.e. forms. It is possible to reference other items in a Web document, but most browsers don't support much interactivity with them at level 0.
There are three ways to reference a form control using DOM level 0:
by name or id
This is the easiest way to reference a form control, as you can clearly see in the XHTML which form you a referring to. For example, this form is named "form1":
<form name="form1" id="form1">...</form>
It would be referenced in the DOM as:
Then if you wanted to reference an element within the form, you would name it as well:
<input type="text" name="fname" />
in the above form.
Each form, and element within the form, is given a number in an array, starting with 0. They are numbered starting with the first <form> element found in the flow of the document. So, to reference the second form on the page:
Then, to reference the second form element within the second form:
a combination of both
It is possible to use any combination of number or name to reference a form or form element within the document:
The W3C has several recommendations for different DOM levels. These levels provide more control and power over the Web documents. But there are also DOMs for other browsers and user agents. These DOMs are not standardized, but if you want to write DHTML for a specific browser only, it would help to learn the specific DOM for that browser.