For example, an AP element can
contain a table that holds table rows that, in turn, hold table data. One node containing another is said to
be in a parent-child relationship, and a node that cannot contain any other nodes is referred to as a leaf node
because it is incapable of supporting any more branches. Figure 2-3 illustrates the node concept.
CAUTION CAUTION
BC 36
Creating a Behavior
FIGURE 2-3
Nodes are used to express the structure of the HTML document and its relationship to the browser.
DOM properties
When referencing a specific tag, the DOM syntax goes from the most general to the most specific. For
example, suppose you want to find out what a user entered into a specific text field, a property called value.
You need to start from the document itself and work your way down through the form and text box objects,
as follows:
var theText = document.formName.textboxName.value;
The DOM dictates what properties are accessible and in what form. Not all properties and methods are supported.
You can??™t, for instance, directly reference the value of a button in a form. Instead, you have to assign
that value to a hidden or other text field and access that value.
BODY
DOCUMENT
TEXT
D
ATA
COMMENTS
ELEMENTS
TABLES
FORMS
BC 37
Creating a Behavior
The portion of the DOM relating directly to forms and form elements is discussed in Chapter
33.
Pages:
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920