Document.doctype
현재 document와 연관된 DTD(Document Type Declaration)를 반환합니다. 반환된 object는 DocumentType
인터페이스를 구현합니다. DocumentType을 작성하려면
DOMImplementation.createDocumentType()
(en-US)를 사용합니다.
Syntax
doctype = document.doctype;
- doctype은 읽기만 가능한 property입니다.
Example
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)
Specifications
Specification | Status | Comment |
---|---|---|
Document Object Model (DOM) Level 3 Core Specification The definition of 'Document.doctype' in that specification. |
Obsolete | <html> element가 없는 HTML documents문서에 대한 리턴 값이 변경되었습니다. document type을 변경할 수 있도록 정의합니다. |
Document Object Model (DOM) Level 2 Core Specification The definition of 'Document.doctype' in that specification. |
Obsolete | 초기 선언. |