textContent
Edit this pageThe textContent
attribute is equivalent to the textContent
DOM property.
This attribute replaces all existing child nodes of the element with a single text node containing the provided string.
Using textContent
can improve performance when the element's children are known to be exclusively text, as it bypasses the generic diffing process.