DOMImplementation.createDocumentType()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
La méthode DOMImplementation.createDocumentType()
renvoie un objet DocumentType
qui peut être utilisé avec DOMImplementation.createDocument
lors de la création du document ou peut être intégré au document existant avec des méthodes comme Node.insertBefore()
ou Node.replaceChild()
.
Syntaxe
js
doctype = document.implementation.createDocumentType(
qualifiedNameStr,
publicId,
systemId,
);
Paramètres
Exemple
js
var dt = document.implementation.createDocumentType(
"svg:svg",
"-//W3C//DTD SVG 1.1//EN",
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd",
);
var d = document.implementation.createDocument(
"http://www.w3.org/2000/svg",
"svg:svg",
dt,
);
alert(d.doctype.publicId); // -//W3C//DTD SVG 1.1//EN
Spécifications
Specification |
---|
DOM Standard # ref-for-dom-domimplementation-createdocumenttype① |
Compatibilité des navigateurs
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
createDocumentType |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.
Voir aussi
- L'interface
DOMImplementation
à laquelle elle appartient.