Node.innerText

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Sommaire

Node.innerText est une propriété représentant le contenu textuel « visuellement rendu » d'un nœud. Utilisé en lecture, il renvoie une approximation du texte que l'utilisateur ou utilisatrice obtiendrait s'il ou elle sélectionnnait le contenu d'un élément avec le curseur, et le copiait dans le presse-papier.

Node.textContent est une alternative similaire, bien qu'il y ait d'importantes différences entre les deux.

Spécifications

Specification
HTML
# the-innertext-idl-attribute

Compatibilité des navigateurs

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
innerText
Can be set with TrustedScript instances in HTMLScriptElement.

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
User must explicitly enable this feature.

Voir aussi