Document Object Model
JavaScript is an interpreted programming language that addresses elements in the browser and on the Web
page in a hierarchical fashion. To access the properties of any object on the page, JavaScript employs a
Document Object Model (DOM). The DOM breaks down the page into successively smaller parts until each
element and its specific properties are identified.
Dreamweaver integrates a subset of objects, properties, and methods from the W3C DOM Level 1 with a
subset of properties from the Internet Explorer 4.0 DOM. The resultant Dreamweaver DOM also includes
some useful features not implemented in either of the other DOMs.
Understanding nodes
Dreamweaver??™s DOM makes available, or exposes, virtually every element on a Web page. The DOM is often
described using a tree metaphor, with the HTML document as the trunk. Instead of regarding the
and the as the major branches, however, Dreamweaver??™s DOM, like the W3C DOM, uses four separate
branches, or nodes, to divide the document:
n DOCUMENT_NODE??”Enables access to objects directly relating to the overall document
n ELEMENT_NODE??”Contains references to all tags in the HTML document
n TEXT_NODE??”Describes the contiguous block of text within tags
n COMMENT_NODE??”Represents the comments within an HTML document and the text strings
they contain
Just as one tree branch can lead to another, nodes can contain other nodes.
Pages:
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919