HTML DOM Element textContent
HTML DOM Element textContent Property
The textContent property is used to either set or return the text content of the specified node. It will also return the text content of all of its descendants. When we are setting this property, it will remove and replace all content with new content.
Syntax:-
Its syntax is:- element.textContent OR element.textContent = text OR node.textContent OR node.textContent = text
Return:-
Its return is:- text content of element with all of its descendants
Further Explanation:-
Property | Description |
text | The text content of the element or node. |