substringData
Summary
Extracts a range of characters from the node.
Method of dom/CharacterDatadom/CharacterData
Syntax
var substring = textualNode.substringData(offset, count);
Parameters
offset
- Data-type
- String
The zero-based offset from which to start.
count
- Data-type
- String
The number of characters to extract.
Return Value
Returns an object of type StringString
The requested substring.
Examples
//create text node
var phrase = document.createTextNode ("A flawed plan today is way better than a perfect plan tomorrow.");
//retrieve substring "way"
var subst = phrase.substringData(23, 3);
//report result
alert(subst);
Notes
If the sum of the offset and count parameters exceeds the number of characters in the object, then an error is returned.
Syntax
Standards information
Related specifications
- DOM Level 3 Core
- Recommendation
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]