Platform Support
IE | Mozilla | Netscape | Opera | Safari | no | 1.0+ | no | 7.0+ | 1.0+ |
---|
Constructors
Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | ||
---|---|---|---|---|---|---|---|---|
CharacterData Constructor() : CharacterData
Object for accessing and processing character data in the DOM.
|
Show Details | no | 1.0+ | no | 7.0+ | 1.0+ | ||
CharacterData() : CharacterDataObject for accessing and processing character data in the DOM. Returns
|
Inherited Properties
Property | Action | IE | Mozilla | Netscape | Opera | Safari |
---|---|---|---|---|---|---|
attributes
: NamedNodeMap
Attributes for an element node.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
childNodes
: NodeList
Child nodes of the current node.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
firstChild
: Node
First child node of the current node.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
lastChild
: Node
Last child node of the current node.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
localName
: String
Local part of an element or attribute name if it the node was defined with an XML Namespace.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
namespaceURI
: String
URI of the namespace for an element or attribute node if the node was defined with an XML Namespace.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
nextSibling
: Node
Sibling node immediately after the current node.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
nodeName
: String
Name of the node. Same as tag name for element nodes.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
nodeType
: Number
Type of node. See Remarks for valid values.
|
Show Details | 5.5+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
nodeValue
: String
Value of the current node.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
ownerDocument
: Document
Document object that contains this node.
|
Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
parentNode
: Node
Parent node of the current node.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
prefix
: String
Namespace prefix for an element or attribute node if the node was defined with an XML Namespace.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
previousSibling
: Node
Sibling node immediately before the current node.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
Properties
Property | Action | IE | Mozilla | Netscape | Opera | Safari |
---|---|---|---|---|---|---|
data
: String
Character data of the current node.
|
Show Details | no | 1.0+ | no | 7.0+ | 1.0+ |
|
||||||
length
: Number
Length of the content of the data property or substringData method.
|
Show Details | no | 1.0+ | no | 7.0+ | 1.0+ |
|
Inherited Functions
Method | Action | IE | Mozilla | Netscape | Opera | Safari | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hasAttributes() : Boolean
Returns true if the node is an element node with attributes.
|
Show Details | no | 1.0+ | 6.0+ | 7.0+ | 1.3+ | ||||||||
Returns
|
||||||||||||||
hasChildNodes() : Boolean
Returns true if the node has child nodes.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | ||||||||
Returns
|
||||||||||||||
isSupported(String feature, [String version]) : Boolean
Returns true if the specified feature and version are supported.
|
Show Details | no | 1.0+ | 6.0+ | 7.0+ | 1.0+ | ||||||||
Parameters
Returns
|
||||||||||||||
normalize() : void
Merges text nodes adjacent to the element to create a normalized DOM.
|
Show Details | N/A | 1.0+ | 6.0+ | 7.0+ | 1.0+ | ||||||||
Returns
|
Functions
Method | Action | IE | Mozilla | Netscape | Opera | Safari | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
appendData(String arg) : void
Appends the specified string to the node text.
|
Show Details | 6.0+ | 1.0+ | no | 7.0+ | 1.0+ | |||||||||||
Parameters
Returns
|
|||||||||||||||||
deleteData(Number offset, Number count) : void
Deletes the indicated range of text.
|
Show Details | 6.0+ | 1.0+ | no | 7.0+ | 1.0+ | |||||||||||
Parameters
Returns
|
|||||||||||||||||
insertData(Number offset, String arg) : void
Inserts the supplied text at the indicated character offset
|
Show Details | 6.0+ | 1.0+ | no | 7.0+ | 1.0+ | |||||||||||
Parameters
Returns
|
|||||||||||||||||
replaceData(Number offset, Number count, String arg) : void
Substitutes the indicated range of text with the supplied string
|
Show Details | 6.0+ | 1.0+ | no | 8.0+ | 1.0+ | |||||||||||
Parameters
Returns
|
|||||||||||||||||
static substringData(Number offset, Number count) : String
Returns the specified range of text.
|
Show Details | 6.0+ | 1.0+ | no | 7.0+ | 1.3+ | |||||||||||
Parameters
Returns
|
Remarks
CharacterData
provides a set of attributes and methods for accessing character data in the DOM. This object
is always inherited by other objects that require this functionality, such as Text
and CDATASection
.
CDATASection
methods manipulate text ranges and considers that the content of the node may be larger than
the limits of the String
object, so CDATASection
methods all work with numeric character offsets
and text ranges. You should already know the ranges that you will need before invoking these methods.
The content
of this node is represented as UTF-16
.
References
Availability
HTML DOM Level 2|W3C