At this level, you start to see a divergence in how these standards
are implemented across browsers.
Mozilla browsers such as Firefox have stuck very closely to the W3C specification,
whereas IE went in a different direction. For example, the current state of event handling
within IE is rooted in its initial implementation that goes back beyond the point
to which DOM Level 2 was even a recommendation in 1999. Unfortunately, they haven??™t
updated the event handling since.
??? DOM Level 3 adds additional extensions to the core and event handling, but most of
the specification hasn??™t reached the recommendation level, and few browsers have
implemented any of the current specification.
Suffice it to say, you??™ll be sticking to Level 1 with a smidge of Level 2.
nNote Although they are often referred to as web standards, in the academic sense they are called recommendations.
The members of a W3C committee work together to develop a set of recommendations for all to
follow.
DOM Tree Structures
The DOM is represented as a tree structure. In HTML, when a tag is inside another tag, it??™s
considered a child element in the DOM:
Here is some text
More text
More text
CHAPTER 2 n HTML, CSS, AND JAVASCRIPT 26
Figure 2-2 shows a graphical representation of how the preceding HTML looks to the
DOM.
Figure 2-2. A simple DOM tree diagram
There are some additional subtleties to the DOM as well.
Pages:
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72