• Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • 参考手册
    • 概述 / Web 技术

      适用于开发者的 Web 技术参考手册

    • HTML

      Web 内容的结构

    • CSS

      用于描述文档样式的代码

    • JavaScript

      通用脚本语言

  • 开发指南
    • 概述 / MDN 学习区

      学习 Web 开发

    • MDN 学习区

      学习 Web 开发

    • HTML

      学习使用 HTML 构建 Web 内容

    • CSS

      学习使用 CSS 设置内容样式

    • JavaScript

      学习在浏览器中运行脚本

  • 更多中文网
  1. 面向开发者的 Web 技术
  2. 网络 API
  3. DocumentType
  4. remove()

目录

  • Syntax
  • Examples
  • Specifications
  • Browser compatibility
  • See also
  1. Document Object Model
  2. DocumentType
  3. Instance properties
    1. name
    2. publicId
    3. systemId
  4. Instance methods
    1. after()
    2. before()
    3. remove()
    4. replaceWith()
  5. Inheritance
    1. Node
    2. EventTarget
  6. Related pages for DOM
    1. AbortController
    2. AbortSignal
    3. AbstractRange
    4. Attr
    5. CDATASection
    6. CharacterData
    7. Comment
    8. CustomEvent
    9. DOMError Deprecated
    10. DOMException
    11. DOMImplementation
    12. DOMParser
    13. DOMPoint
    14. DOMPointReadOnly
    15. DOMRect
    16. DOMTokenList
    17. Document
    18. DocumentFragment
    19. Element
    20. Event
    21. EventTarget
    22. HTMLCollection
    23. MutationObserver
    24. MutationRecord
    25. NamedNodeMap
    26. Node
    27. NodeIterator
    28. NodeList
    29. ProcessingInstruction
    30. Range
    31. StaticRange
    32. Text
    33. TextDecoder
    34. TextEncoder
    35. TimeRanges
    36. TreeWalker
    37. XMLDocument

目录

  • Syntax
  • Examples
  • Specifications
  • Browser compatibility
  • See also

DocumentType: remove() method

The DocumentType.remove() method removes a document's doctype.

Syntax

js
remove()

Parameters

None.

Return value

None (undefined).

Examples

Using remove()

js
document.doctype; // "<!DOCTYPE html>'
document.doctype.remove();
document.doctype; // null

Specifications

Specification
DOM Standard
# ref-for-dom-childnode-remove①

Browser compatibility

BCD tables only load in the browser

See also

  • Document.doctype
MDN Web 中文网 - 粤ICP备13048890号