HTML DOM Document doctype 屬性
- 上一頁 designMode
- 下一頁 documentElement
- 返回上一層 HTML DOM Documents
定義和用法
doctype
屬性返回文檔的 doctype(作為 DocumentType 對象)。
如果文檔沒有 doctype,則 doctype
屬性返回 null。
doctype
屬性是只讀的。
doctype.name
屬性返回 doctype 的名稱。
另請參閱:
語法
document.doctype
返回值
類型 | 描述 |
---|---|
對象 | DocumentType 對象。 |
瀏覽器支持
document.doctype
是 DOM Level 1 (1998) 特性。
所有瀏覽器都支持它:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
支持 | 9-11 | 支持 | 支持 | 支持 | 支持 |
- 上一頁 designMode
- 下一頁 documentElement
- 返回上一層 HTML DOM Documents