↑
Main Page
DOM Basics
DOM Basics
The Document Object Model (DOM) is perhaps the single greatest innovation on the Web since
HTML was first used to connect related documents together over the Internet. The DOM gives
developers unprecedented access to HTML, enabling them to manipulate and view HTML as an
XML document. The DOM represents the evolution of Dynamic HTML, pioneered by Microsoft
and Netscape, into a true cross-platform, language-independent solution.
What Is the DOM?
Before I discuss exactly what the DOM is, you should know what led to its creation. Although the
DOM was heavily influenced by the rise of Dynamic HTML in browsers, the W3C took a step
backward and first applied it to XML.
Introduction to XML
The eXtensible Markup Language (XML) was derived from an earlier language called Standard
Generalized Markup Language (SGML). SGML’s main purpose was to define the syntax of
markup languages to represent data using tags.
Tags consist of text enclosed between a less-than symbol (
<
) and a greater-than symbol (
>
), as in
<tag>
.
Start tags
begin a particular area, such as
<start>
;
end tags
define the end of an area. They
look the same as start tags but have a forward slash (
/
) immediately following the less-than sym-
bol, as in
</end>
. SGML also defines attributes for tags, which are values assigned inside of the
less-than and greater-than symbols, such as the
src
attribute in
<img src=”picture.jpg”>
. If
this looks familiar, it should; the most famous implementation of an SGML-based language is the
original HTML.
09_579088 ch06.qxd 3/28/05 11:37 AM Page 159
Free JavaScript Editor
Ajax Editor
©
→