DocumentType

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.

DocumentType インターフェイスは、 doctype を包含する Node を表します。

EventTarget Node DocumentType

インスタンスプロパティ

親インターフェイスである Node からプロパティを継承しています。

DocumentType.name 読取専用

文書の型です。HTML 文書では常に "html" ですが、XML 文書では様々です。

DocumentType.publicId 読取専用

文字列で、文書型の識別子です。HTML では常に空文字列 ("") ですが、例えば SVG 文書では "-//W3C//DTD SVG 1.1//EN" です。

DocumentType.systemId 読取専用

文字列で、DTD に関連付けられた URL が入ります。HTML では常に空文字列 ("") ですが、例えば SVG 文書では "http://www.w3.org/2000/svg" です。

インスタンスメソッド

親インターフェイスである Node からメソッドを継承しています。

DocumentType.after()

一連の Node オブジェクトまたは文字列を、この DocumentType の親の子リストの中、この DocumentType オブジェクトの直後に挿入します。

DocumentType.before()

一連の Node オブジェクトまたは文字列を、この DocumentType の親の子リストの中、この DocumentType オブジェクトの直前に挿入します。

DocumentType.remove()

オブジェクトをその親の子リストから削除します。

DocumentType.replaceWith()

文書型を指定されたノードの集合に置き換えます。

仕様書

Specification
DOM
# interface-documenttype

ブラウザーの互換性

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
DocumentType
after
before
name
publicId
remove
replaceWith
systemId

Legend

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

Full support
Full support

関連情報