Baseline Widely available
The DocumentType.replaceWith()
method replaces the document type with a set of given nodes.
replaceWith(node1)
replaceWith(node1, node2)
replaceWith(node1, node2, /* â¦, */ nodeN)
Parameters
node1
, â¦, nodeN
A set of nodes to replace the DocumentType
with.
None (undefined
).
HierarchyRequestError
DOMException
Thrown when the node cannot be inserted at the specified point in the hierarchy.
replaceWith()
let svg_dt = document.implementation.createDocumentType(
"svg:svg",
"-//W3C//DTD SVG 1.1//EN",
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd",
);
document.doctype.replaceWith(svg_dt);
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4