O'Reilly logo

Professional: JavaScript® for Web Developers, Third Edition by Nicholas C. Zakas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12

DOM Levels 2 and 3

WHAT’S IN THIS CHAPTER?

  • Changes to the DOM introduced in Levels 2 and 3
  • The DOM API for manipulating styles
  • Working with DOM traversal and ranges

The first level of the DOM focuses on defining the underlying structure of HTML and XML documents. DOM Levels 2 and 3 build on this structure to introduce more interactivity and support for more advanced XML features. As a result, DOM Levels 2 and 3 actually consist of several modules that, although related, describe very specific subsets of the DOM. These modules are as follows:

  • DOM Core — Builds on the Level 1 core, adding methods and properties to nodes.
  • DOM Views — Defines different views for a document based on stylistic information.
  • DOM Events — Explains how to tie interactivity to DOM documents using events.
  • DOM Style — Defines how to programmatically access and change CSS styling information.
  • DOM Traversal and Range — Introduces new interfaces for traversing a DOM document and selecting specific parts of it.
  • DOM HTML — Builds on the Level 1 HTML, adding properties, methods, and new interfaces.

This chapter explores each of these modules except for DOM events, which are covered fully in Chapter 13.

image

DOM Level 3 also contains the XPath module and the Load and Save module. These are discussed in Chapter 18.

DOM CHANGES

The purpose of the DOM Levels 2 and 3 Core is to expand the DOM API to encompass ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required