CW3C DOM Reference

Because JavaScript is primarily used to program the browser and add behavior to web pages, it’s only natural to include a reference to the W3C DOM.

The following pages list the objects made available by the W3C DOM.

DOM CORE OBJECTS

This section describes and lists objects defined by the DOM standards—starting with the lowest level of DOM objects. All objects are in alphabetical order.

Low-Level DOM Objects

The DOM specification describes the Node, NodeList, and NamedNodeMap objects. These are the lowest-level objects in the DOM, and are the primary building blocks of higher-level objects.

Node

Defined in DOM Level 1, the Node object is the primary data type for the entire DOM. All objects in the DOM inherit from Node. There are 12 different types of Node objects; each type has an associated integer value. The following tables list the Node object’s type values, properties, and methods.

Node Types

TYPE NAME INTEGER VALUE INTRODUCED ASSOCIATED DATA TYPE
ELEMENT_NODE 1 Level 1 Element
ATTRIBUTE_NODE 2 Level 1 Attr
TEXT_NODE 3 Level 1 Text
CDATA_SECTION_NODE 4 Level 1 CDATASection
ENTITY_REFERENCE_NODE 5 Level 1 EntityReference
ENTITY_NODE 6 Level 1 Entity
PROCESSING_INSTRUCTION_NODE 7 Level 1 ProcessingInstruction
COMMENT_NODE 8 Level 1 Comment
DOCUMENT_NODE 9 Level 1 Document
DOCUMENT_TYPE_NODE 10 Level 1 DocumentType
DOCUMENT_FRAGMENT_NODE 11 Level 1 DocumentFragment
NOTATION_NODE 12 Level 1 Notation

Properties

Get Beginning JavaScript, 5th 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.