HTML DOMouterText Property
Example
Set the outer text of an element:
Description
The outerText property sets or returns the text content of the specified node.
This property is similar to the innerinnerText property, in factgetting the outerText returns the same result asgetting the innerText property.
There are an important difference whensetting an element's outerText, because the element itself is removed.
Tip: also check out theouterHTML property.
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| outerText | 43 | 11 | Not supported | 6 | 61 |
Syntax
Return the text content of a node:
Set the text content of a node (replacing the entire node):
Property Values
| Value | Type | Description |
|---|---|---|
| text | String | Specifies the text content to insert |
Technical Details
| Return Value: | A String, representing the text content of a node and all its descendants |
|---|

