![]() |
VOOZH | about |
The DOM innerText Property is used to set or return the text content of a specified node and its descendants. This property is very similar to the text content property but returns the content of all elements, except for <script> and <style> elements.
Syntax: It is used to set the innerText property.
node.innerText = text
Return Value: It returns a string value that represents the text content of the element along with its descendants.
Example 1: In this example, we will see DOM innerText Property
Output:
Example 2: In this example, we will see DOM innerText Property
Output:
Supported Browsers: The browser supported by DOM innerText property are listed below: