HTML DOM Element innerText
HTML DOM Element innerText Property
The innerText property is used to either set or return the text content of an element. When setting, it will erase all previous nodes and add a new node.
Syntax:-
Its syntax is:- element.innerText OR element.innerText = text
Return:-
Its return is:- text content of the element with all of its descendants except style and script tags
Further Explanation:-
Property | Description |
text | The text content of the element. |