Text Nodes
The ensure interoperability, the DOM defines a standard data type for representing character data in a source document. The DOM defines the DOMString as asequence of 16-bit units (encoded using UTF-16) for this purpose.[10] The DOM also defines a generic CharacterData interface deriving from Node that encapsulates DOMString and provides behavior for inserting, appending, replacing, and deleting the DOMString's value. All other DOM interfaces that deal directly with character data extend the CharacterData interface, which itself extends Node.
[10] As stated in the DOM specification, DOM implementations are required to encode DOMString's using UTF-16 because of its widespread industry practice. However, because XML' character set is ...
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