Name

innerText — NN n/a IE 4 DOM n/a

Synopsis

Read/Write

The rendered text (but not any tags) of the current element. If you want the rendered text as well as any nested HTML tags, see innerHTML. Any changes to this property are not rendered through the HTML parser, meaning that any HTML tags you include are treated as displayable text content only. You may change this property only after the document has fully loaded. Changes to the innerText property are not reflected in the source code when you view the source in the browser. This property is not supported in many objects in the Macintosh version of Internet Explorer 4.

Example

document.all.elementID.innerText = "How now brown cow?"

Value

String.

Default

None.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.