JavaScripture
Contribute via GitHub Feedback

JavaScript CharacterData : Node

The base class for Text, Comment, and ProcessingInstruction Node types.

Instance Properties

data : String

The text in the node.

Example:

Run

Results:

 

length : Number  

The length of data.

Example:

Run

Results:

 

Instance Methods

appendData(data : String) : undefined

Appends data to the end of the this.data.

Example:

Run

Results:

 

deleteData(offset : Number, count : Number) : undefined

Deletes count characters of this.data starting at offset.

Example:

Run

Results:

 

insertData(offset : Number, data : String) : undefined

Inserts data into this.data at offset.

Example:

Run

Results:

 

remove() : undefined

Removes this from parentNode's children.

Example:

Run

Results:

 

replaceData(offset : Number, count : Number, data : String) : undefined

Replaces count characters of text at offset in this.data with data.

Example:

Run

Results:

 

substringData(offset : Number, count : Number) : String

Returns a substring of this.data starting at offset and of the specified count of characters.

Example:

Run

Results: