Document.characterSet - 文字エンコーディング
characterSetは、Documentのプロパティです。ドキュメントの文字エンコーディングを返します。
概要
- 名前
- characterSet
- 所属
- Document
- IDL
readonly attribute DOMString characterSet;
- 仕様書
- https://dom.spec.whatwg.org/#dom-document-characterset
説明
文字エンコーディングを返す。読み取り専用なので、値を代入して変更することはできない。
デモ
Document.characterSetのデモです。
<!-- このコードは編集できます。 -->
<!DOCTYPE html>
<html>
<body>
<script>
var value = document.characterSet ;
console.log( value ) ;
document.body.appendChild( new Text( value ) ) ;
</script>
</body>
</html>
サポート状況
Chrome | Firefox | Safari | Edge | IE | Opera | iOS Safari | Android |
---|---|---|---|---|---|---|---|
● | ● | ● | ● | ● 9+ | ● | ● | ● |
関連記事
- Document.contentType
- contentTypeは、Documentのプロパティです。ドキュメントのmime typeを返します。
- Document()
- Document()は、Documentのコンストラクタです。新しいオブジェクトを作成します。
- Document.charset
- charsetは、Documentのプロパティです。ドキュメントの文字エンコーディングを返します。このプロパティは歴史的な理由で残されています。代わりにcharacterSetを使って下さい。
- Document.visibilityState
- visibilityStateは、Documentのプロパティです。最上位のブラウジングコンテキストが持つドキュメントの表示状態を文字列で返します。