Приглашаем посетить
Экономика (economics.niv.ru)

The HTML Document

PART II

Chapter 6

The HTML Document

The structure, contents, and style of an HTML document are exposed through the document property on the window. The document property references an object that encapsulates all the information about the document. The document object is the most important and powerful object of the Dynamic HTML object model. Through this object, all elements contained in the document can fire events and can be accessed and modified by scripts, allowing you to create a dynamic document.

The elements in the HTML document are exposed through the collections on the document object. The contents of the document are accessible through these elements and through a TextRange object. Both techniques allow you to access and change the contents. The style of the document is exposed through the styleSheets collection, which provides access to the global and linked style sheets associated with the document.

Our discussion of these issues will span several chapters. This chapter begins the discussion by covering the following topics:

Figure 6-1 shows the document object and the collections it contains. Next to each collection is the tag for the HTML elements it contains.

The HTML Document

Figure 6-1. The document object's collections and the corresponding HTML elements.

[Содержание]