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
Supported3 of 3 checks work.
Report a wrong result for warpdomhappy-dom 21.0.3
Partial2 of 3 checks work.
- For a connected <p>a<br>b</p>, innerText is "a\nb".
- Result:
innerText: expected "a\nb", got "ab"
- Result:
jsdom 30.1.3
MissingMissing: in this engine's window, this does not hold: "innerText" in element.
Report a wrong result for jsdomlinkedom 0.18.13
Partial1 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"
- Result:
- Setting innerText = "a\nb" produces the children a, <br>, b.
- Result:
TypeError: Cannot set property innerText of [object Object] which has only a getter
- Result:
Checks
Exists when: "innerText" in element.