We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


Node.innerText 是一个表示一个节点及其后代的“渲染”文本内容的属性。

作为一个获取器,如果用光标突出显示元素的内容,然后将其复制到剪贴板,则它将近似于用户将获得的文本。此功能最初由Internet Explorer引入,并在所有主要浏览器供应商采用后于2016年在HTML标准中正式规定。

Node.textContent 是一个有点类似的替代方案,虽然两者之间有重要的区别。


Specification Status Comment
HTML Living Standard
Living Standard Introduced, based on the draft of the innerText specification. See whatwg/html#465 and whatwg/compat#5 for history.


We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 4 45 (45) 6 9.6 (probably earlier) 3
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 2.3 (probably earlier) 45.0 (45) 10 (probably earlier) 12 4.1 (probably earlier)



此页面的贡献者: keifergu, xgqfrms-GitHub, Aolose
最后编辑者: keifergu,