HTMLElement: contentEditable プロパティ

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.

* Some parts of this feature may have varying levels of support.

contentEditableHTMLElement インターフェイスのプロパティで、要素が編集可能かどうかを指定します。

これは列挙属性で、次の値を設定できます。

  • 'true' は、要素の内容が編集可能 (contenteditable) であることを示します。
  • 'false' は、要素が編集できないことを示します。
  • 'plaintext-only' は要素の生のテキストは編集可能ですが、リッチテキストの書式は編集できないことを示します。

HTMLElement.isContentEditable プロパティを使用すると、このプロパティの計算済みの論理値をテストできます。

属性がない、またはその値が不正な場合、その値は親要素から継承されます。したがって、要素は親要素に基づいて編集可能(または不可能)になります。

文字列。

仕様書

Specification
HTML
# contenteditable

ブラウザーの互換性

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
contentEditable
plaintext-only as a value

Legend

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

Full support
Full support
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.

関連情報