CharacterData in DOM Level 2 Core

The Character Data interface is the base class for all textual content nodes.

For more information see

Inherits from:

Inerhited by:

Instance Properties

name type description
attributes NamedNodeMap (read only) [from Node]
childNodes NodeList (read only) [from Node]
data String
firstChild Node (read only) [from Node]
lastChild Node (read only) [from Node]
length Number (read only)
localName String (read only) [from Node]
namespaceURI String (read only) [from Node]
nextSibling Node (read only) [from Node]
nodeName String (read only) [from Node]
nodeType Number (read only) [from Node]
nodeValue String [from Node]
ownerDocument Document (read only) [from Node]
parentNode Node (read only) [from Node]
prefix String [from Node]
previousSibling Node (read only) [from Node]

Instance Methods

name returns description
addEventListener(type,listener,useCapture) (none) [from EventTarget]
appendChild(newChild) Node [from Node]
appendData(arg) (none)
cloneNode(deep) Node Return a new copy of the node. [from Node]
deleteData(offset,count) (none)
dispatchEvent(evt) Boolean Dispatches an event to the invoking object. [from EventTarget]
hasAttributes() Boolean [from Node]
hasChildNodes() Boolean [from Node]
insertBefore(newChild,refChild) Node [from Node]
insertData(offset,arg) (none)
isSupported(feature,version) Boolean [from Node]
normalize() (none) [from Node]
removeChild(oldChild) Node [from Node]
removeEventListener(type,listener,useCapture) (none) [from EventTarget]
replaceChild(newChild,oldChild) Node [from Node]
replaceData(offset,count,arg) (none)
substringData(offset,count) String



The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to CharacterData, though Text and others do inherit the interface from it. All offsets in this interface start from 0.

As explained in the DOMString interface, text strings in the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on CharacterData is done in 16-bit units.