Document.doctype
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 7ì.
íì¬ documentì ì°ê´ë DTD(Document Type Declaration)를 ë°íí©ëë¤. ë°íë objectë DocumentType ì¸í°íì´ì¤ë¥¼ 구íí©ëë¤. DocumentType ì ìì±íë ¤ë©´ DOMImplementation.createDocumentType()를 ì¬ì©í©ëë¤.
Syntax
js
doctype = document.doctype;
- doctypeì ì½ê¸°ë§ ê°ë¥í propertyì ëë¤.
Example
js
var doctypeObj = document.doctype;
console.log(
"doctypeObj.name: " +
doctypeObj.name +
"\n" +
"doctypeObj.internalSubset: " +
doctypeObj.internalSubset +
"\n" +
"doctypeObj.publicId: " +
doctypeObj.publicId +
"\n" +
"doctypeObj.systemId: " +
doctypeObj.systemId,
);
Notes
íì¬ documentì ì°ê´ë DTDê° ìì¼ë©´, ì´ propertyë nullì ë°íí©ëë¤.
DOM level 2ë document type ì ì¸ í¸ì§ì ì§ìíì§ ììµëë¤. (read-only)
ëª ì¸ì
| Specification |
|---|
| DOM > # ref-for-dom-document-doctypeâ > |