MDN self-hosted library · e01.org

DocumentType: remove() method

DOM

DOM

The remove() method of the DocumentType interface removes the DocumentType node from its parent node. Nothing happens if 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()