DOM HTMLElement.innerText Property
The innerText property gets the text of an element as it appears on screen, respecting CSS, or replaces its content with text.
Description
The innerText property returns the rendered text of an element: what a user would get by selecting and copying it. Unlike textContent, it leaves out hidden elements, follows CSS such as text-transform, and turns block elements and <br> into line breaks. Because it depends on CSS, reading it triggers a layout calculation, so it's slower.
Setting it replaces the element's content with text, converting line breaks into <br> elements.
Because reading innerText can force the browser to recalculate layout, avoid reading it in tight loops. Use it when you specifically need the text as the user sees it, such as copying visible text to the clipboard, and textContent otherwise.
Syntax
element.innerText
element.innerText = textValue
A string of the element's rendered text, as it appears on screen.
Example
Browser Support
The following information will show you the current browser support for the HTMLElement.innerText property. Hover over a browser icon to see the version that first introduced support for this property.
Desktop





Tablets & Mobile





