Sei sulla pagina 1di 1

textContent returns null if the element is a document, a document type, or a

notation. To grab all of the text and CDATA data for the whole document, one could
use document.documentElement.textContent.
If the node is a CDATA section, a comment, a processing instruction, or a text
node, textContent returns the text inside this node (the nodeValue).
For other node types, textContent returns the concatenation of the textContent
property value of every child node, excluding comments and processing instruction
nodes. This is an empty string if the node has no children.
Setting this property on a node removes all of its children and replaces them with
a single text node with the given value.

Potrebbero piacerti anche