Chapter 2. Document Object Model Reference

This chapter focuses on objects in documents—the scriptable entities that a browser maintains in its memory whenever a document is loaded. Most of these objects are created for you when the browser interprets the tags embedded within the content of the document. But many more objects exist solely for the purposes of scripting activities, such as event processing, window manipulation, creating and populating documents with new objects, reading the client’s system environment, and even XML data that is part of an AJAX exchange with a server.

An object is described by its properties, methods, collections (or arrays) of nested items, and events. The Dynamic HTML features that you associate with a document rely entirely upon the objects and the properties, methods, and events that are supported by the browsers used by the page’s visitors. The scriptable object model of early browsers was a simple one, with relatively few objects, and those objects had short lists of implemented properties, methods, and events. Today’s model, however, is huge, due to a greatly expanded object model for Microsoft Internet Explorer 4 and, more recently, the addition of a completely new (and still growing) abstract object model designed by the W3C. That newest object model, the W3C DOM, is the model for which any new DHTML scripting should be targeted, as it is supported to various extents by all modern mainstream scriptable browsers.

To help you choose the right ...

Get Dynamic HTML: The Definitive Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.