Replaces a specified range of characters in the node with a new character string.
Method of dom/CharacterDatadom/CharacterData
Syntax textualNode.replaceData(offset, count, text);
Parameters offset
The zero-based offset from which to start.
countThe number of characters to replace.
textThe new character string.
Return ValueNo return value
Examples//create text node
var phrase = document.createTextNode ("A flawed plan today is much better than a perfect plan tomorrow.");
//replace "much" with "way"
phrase.replaceData(23, 4, "way");
//report result
alert(phrase.data);
Notes
If the sum of the offset and count parameters exceeds the number of characters in the object, then all the characters from the offset to the end of the data are replaced.
Related specificationsMicrosoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4