textContent: DOMString(3)
This attribute provides a quick method to get and
set the textual content of nodes within the document tree. When
used to retrieve text, it returns the contents of all descendant
Text
nodes without any
whitespace normalization. Markup nodes (Attr
, Element
, and so forth) are ignored. When
used to set text, it causes any child nodes to be removed and a
single Text
node to be created
and linked in as the only child of the target node. The following
table shows how the textContent
attribute is constructed for the various node types:
Thrown on set if node is read-only.
Thrown on get when length of text content would exceed
the maximum allowable length of a DOMString
on the implementation
platform.