C H A P T E R  31

Using the Element-Specific Objects

The Document Object Model (DOM) defines a set of objects that represent the different types of HTML elements in a document. These objects can be treated as HTMLElement objects and, for the most part, that’s what you typically do in your scripts. But if you want to access some attribute or feature that is unique to an element, you can usually do so using one of these objects.

These objects are not much use. They generally define properties that correspond to attributes supported by an element, the value of which you can access through the features of the HTMLElement. There are a couple of exceptions—the form elements have some helpful methods for use with input validation, and the table elements ...

Get The Definitive Guide to HTML5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.