domdocs

jQuery API style docs for native DOM functionality.

Check out a list of all entries, or pick a tag from the menu aboveleft.

See the GitHub project to recommend improvements.

Much of the information included here is taken from the DOM specification by WHATWG. Not everything in the specification (spec) is described here, instead what is deemed most useful to web developers is documented. For full information, always consult the spec.

While the DOM is not necessarily tied to JavaScript (JS), JS is the most common way to interact with the DOM. As such, all the examples use JS. Specifically, the examples use ES6/ES2015.

For updates on domdocs,

Note: Some of the methods described here are not implemented by current browsers. A link to a polyfill is given if this is the case. Hopefully, this site will stimulate further use of these new APIs and encourage browser makers to implement them.

Terminology

DOM
Document Object Model.
Node
A node in the DOM tree, includes Elements, Text Nodes, the Document, and Document Fragments.
Text Node
A node representing text. Often simply visualized as text in developer tools, not as a node.
Element
A node representing an HTML element.
Document
The root node of the DOM tree.
DocumentFragment
A minimal document with no parent. When inserted, its children are inserted instead of itself.
ParentNode
An interface implemented by Element, Document, and DocumentFragment.
NodeList
A collection of nodes - not an Array, see more.
HTMLCollection
A collection of elements - not an Array, see more.
Elements
A collection of elements - a subclass of Array, see more.