English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML DOM doctype 속성

HTML DOM Document 객체

DOCTYPE읽기 전용 속성은 현재 문서와 관련된 문서 타입 선언(DTD)을 반환합니다.

반환하는 객체는 DocumentType 객체를 구현합니다.

DocumentType 객체는name속성을 반환합니다. 이 속성은 doctype의 이름을 반환합니다.

현재 문서와 연결된 DTD가 없으면 doctype 속성은null.

문법:

document.doctype
var doctypeObj = document.doctype;
doctypeObj.name;
테스트 보기‹/›

브라우저 호환성

모든 브라우저는 doctype 속성을 완전히 지원합니다:

속성
doctypeOOOOO

기술 세부 사항

반환 값:문서의 doctype, DocumentType 객체로서
DOM 버전:DOM 등급1

HTML DOM Document 객체