JavaScript Objects

The Document Object Model, the main source of objects for JavaScript, puts an object interface on both the HTML document and the browser. JavaScript can interact with the browser to load a new page, examine the browser's history—previously loaded Web pages—or interact with pages in neighboring frames.

The principal object to use when working with document content is the document object. A reference to it can be obtained through the document property of the window object, which is a globally available object in any JavaScript function. JavaScript uses “dot notation” to navigate through the properties and references associated with the document. For example, the following JavaScript function initializes a text field in a form ...

Get Building Web Applications with UML Second 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.