Document: doctype-Eigenschaft

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.

Die doctype-Schreibgeschützte Eigenschaft des Document-Interfaces ist ein DocumentType-Objekt, das die Document Type Declaration (DTD) darstellt, die mit dem aktuellen Dokument verknüpft ist.

Wert

Ein DocumentType-Objekt.

Beispiele

js
const doctypeObj = document.doctype;

console.log(`doctypeObj.name: ${doctypeObj.name}`);
console.log(`doctypeObj.internalSubset: ${doctypeObj.internalSubset}`);
console.log(`doctypeObj.publicId: ${doctypeObj.publicId}`);
console.log(`doctypeObj.systemId: ${doctypeObj.systemId}`);

Anmerkungen

Die Eigenschaft gibt null zurück, wenn kein DTD mit dem aktuellen Dokument verknüpft ist.

DOM Level 2 unterstützt nicht das Bearbeiten der Dokumenttyp-Deklaration.

Spezifikationen

Specification
DOM
# ref-for-dom-document-doctype①

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
doctype

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support