The CharacterData Interface
The CharacterData interface contains all the attributes and methods for accessing and editing the string portions of the interface, whether they are in text nodes, comment nodes, or any of the other nodes that take a string value.
The data Attribute
The data attribute will return all the text in the node as a Unicode string.
The length Attribute
The length attribute will return the number of characters in the string.
The subStringData() Method
This method will return a substring of the string in question. It takes two arguments, both unsigned long integers. The first argument is the offset parameter, which indicates the position of the start of the sub-string. The second argument is the count parameter, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access