SUMMARY
While the DOM specifies the core API for interacting with XML and HTML documents, there are several specifications that provide extensions to the standard DOM. Many of the extensions are based on proprietary extensions that later became de facto standards as other browsers began to mimic their functionality. The three specifications covered in this chapter are:
- Selectors API, which defines two methods for retrieving DOM elements based on CSS selectors:
querySelector()
,querySelectorAll(),
andmatches()
. - Element Traversal, which defines additional properties on DOM elements to allow easy traversal to the next related DOM element. The need for this arose because of the handling of white space in the DOM that creates text nodes between elements.
- HTML5, which provides a large number of extensions to the standard DOM. These include standardization of de facto standards such as
innerHTML
, as well as additional functionality for dealing with focus management, character sets, scrolling...