insertData
Summary
Inserts a new character string into the node at the specified offset.
Method of dom/CharacterDatadom/CharacterData
Syntax
textualNode.insertData(offset, text);
Parameters
offset
- Data-type
- String
The zero-based offset from which to start.
text
- Data-type
- String
The new character string.
Return Value
No return value
Examples
//create text node
var phrase = document.createTextNode ("A flawed plan today is better than a perfect plan tomorrow.");
//insert "much " (note trailing space)
phrase.insertData(23, "much ");
//report result
alert(phrase.data);
Related specifications
- DOM Level 3 Core
- Recommendation
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]