Skip to main content

element.innerText

The rendered text of an element (line breaks, hidden content left out) and a setter that turns newlines into <br>. Specification: html.spec.whatwg.org/multipage/dom.html.

Results​

Probed on 2026-10-19 with Node.js v22.23.3.

warpdom 0.1.6​

Supported

3 of 3 checks work.

Report a wrong result for warpdom

happy-dom 21.0.3​

Partial

2 of 3 checks work.

  • For a connected <p>a<br>b</p>, innerText is "a\nb".
    • Result: innerText: expected "a\nb", got "ab"
Report a wrong result for happy-dom

jsdom 30.1.3​

Missing

Missing: in this engine's window, this does not hold: "innerText" in element.

Report a wrong result for jsdom

linkedom 0.18.13​

Partial

1 of 3 checks work.

  • Text inside a display: none child is left out: <div>a<span style="display:none">b</span></div> gives "a".
    • Result: innerText: expected "a", got "ab"
  • Setting innerText = "a\nb" produces the children a, <br>, b.
    • Result: TypeError: Cannot set property innerText of [object Object] which has only a getter
Report a wrong result for linkedom

Checks​

Exists when: "innerText" in element.

  • br-newline: For a connected <p>a<br>b</p>, innerText is "a\nb". (spec)
  • display-none-skipped: Text inside a display: none child is left out: <div>a<span style="display:none">b</span></div> gives "a". (spec)
  • setter-br: Setting innerText = "a\nb" produces the children a, <br>, b. (spec)