非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

HTMLElement.outerText is a non-standard property. As a getter, it returns the same value as Node.innerText . As a setter, it removes the current node and replaces it with the given text.

范例

See this StackOverflow answer.

规范

Not part of any specification. Standards discussion: whatwg/html#668 .

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
outerText 非标 Chrome 43 Edge 12 Firefox No IE Yes Opera Yes Safari 6 WebView Android 43 Chrome Android 43 Firefox Android No Opera Android Yes Safari iOS Yes Samsung Internet Android 4.0

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

另请参阅

元数据

  • 最后修改:
  1. DOM (文档对象模型)
  2. HTMLElement
  3. 特性
    1. contentEditable
    2. contextMenu
    3. dir
    4. hidden
    5. innerText
    6. isContentEditable
    7. lang
    8. offsetHeight
    9. offsetLeft
    10. offsetParent
    11. offsetTop
    12. offsetWidth
    13. onabort
    14. onanimationcancel
    15. onanimationend
    16. onanimationiteration
    17. onauxclick
    18. onblur
    19. oncancel
    20. oncanplay
    21. oncanplaythrough
    22. onchange
    23. onclick
    24. onclose
    25. oncontextmenu
    26. oncopy
    27. oncuechange
    28. oncut
    29. ondblclick
    30. ondurationchange
    31. onended
    32. onerror
    33. onfocus
    34. onformdata
    35. ongotpointercapture
    36. oninput
    37. oninvalid
    38. onkeydown
    39. onkeypress
    40. onkeyup
    41. onload
    42. onloadeddata
    43. onloadedmetadata
    44. onloadend
    45. onloadstart
    46. onlostpointercapture
    47. onmousedown
    48. onmouseenter
    49. onmouseleave
    50. onmousemove
    51. onmouseout
    52. onmouseover
    53. onmouseup
    54. onpaste
    55. onpause
    56. onplay
    57. onplaying
    58. onpointercancel
    59. onpointerdown
    60. onpointerenter
    61. onpointerleave
    62. onpointermove
    63. onpointerout
    64. onpointerover
    65. onpointerup
    66. onreset
    67. onresize
    68. onscroll
    69. onselect
    70. onselectionchange
    71. onselectstart
    72. onsubmit
    73. ontouchcancel
    74. ontouchstart
    75. ontransitioncancel
    76. ontransitionend
    77. onwheel
    78. outerText
    79. title
  4. 方法
    1. click()
    2. forceSpellCheck()
  5. 事件
    1. animationcancel
    2. animationend
    3. animationiteration
    4. animationstart
    5. beforeinput
    6. change
    7. gotpointercapture
    8. input
    9. lostpointercapture
    10. pointercancel
    11. pointerdown
    12. pointerenter
    13. pointerleave
    14. pointermove
    15. pointerout
    16. pointerover
    17. pointerup
    18. transitioncancel
    19. transitionend
    20. transitionrun
    21. transitionstart
  6. 继承:
    1. 元素
    2. 节点
    3. EventTarget
  7. DOM 相关页面
    1. AbortController
    2. AbortSignal
    3. AbstractRange
    4. Attr
    5. ByteString
    6. CDATASection
    7. CSSPrimitiveValue
    8. CSSValue
    9. CSSValueList
    10. CharacterData
    11. ChildNode
    12. 注释
    13. CustomEvent
    14. DOMConfiguration
    15. DOMError
    16. DOMErrorHandler
    17. DOMException
    18. DOMImplementation
    19. DOMImplementationList
    20. DOMImplementationRegistry
    21. DOMImplementationSource
    22. DOMLocator
    23. DOMObject
    24. DOMParser
    25. DOMPoint
    26. DOMPointInit
    27. DOMPointReadOnly
    28. DOMRect
    29. DOMString
    30. DOMTimeStamp
    31. DOMTokenList
    32. DOMUserData
    33. Document
    34. DocumentFragment
    35. DocumentType
    36. 元素
    37. ElementTraversal
    38. Entity
    39. EntityReference
    40. 事件
    41. EventTarget
    42. HTMLCollection
    43. MutationObserver
    44. 节点
    45. NodeFilter
    46. NodeIterator
    47. NodeList
    48. NonDocumentTypeChildNode
    49. ProcessingInstruction
    50. PromiseResolver
    51. 范围
    52. StaticRange
    53. 文本
    54. TextDecoder
    55. TextEncoder
    56. TimeRanges
    57. TreeWalker
    58. TypeInfo
    59. USVString
    60. UserDataHandler
    61. XMLDocument