DOM
The remove() method of the DocumentType interface removes the DocumentType node from its parent node. Nothing happens if Node.parentNode is null.
Syntax
remove()
Parameters
None.
Return value
None (undefined).
Examples
Using remove()
document.doctype; // "<!doctype html>'
document.doctype.remove();
document.doctype; // null
Specifications
Browser compatibility
See also
- Document.doctype
- CharacterData.remove()
- Element.remove()
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
