This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

deleteData

Summary

Removes a specified range of characters from the node.

Method of dom/CharacterDatadom/CharacterData

Syntax

 textualNode.deleteData(offset, count);

Parameters

offset

Data-type
String

The zero-based character offset from which to start.

count

Data-type
String

The number of characters to remove.

Return Value

No return value

Examples

//create text node
var phrase = document.createTextNode ("A flawed plan today is not better than a perfect plan tomorrow.");
//delete "not " (note trailing space)
phrase.deleteData(23, 4);
//report result
alert(phrase.data);

Usage

 Upon success of this method, the data and length properties reflect the change.

Related specifications

DOM Level 3 Core
Recommendation

Attributions