contenteditable

contenteditable 전역 특성은 사용자가 요소를 편집할 수 있는지 나타내는 열거형 특성입니다.

가능한 값은 다음과 같습니다.

  • true 또는 빈 문자열은 요소가 편집 가능함을 나타냅니다.
  • false는 요소가 편집 불가능함을 나타냅니다.

값 없이, <label contenteditable>예제</label>처럼 사용할 경우 빈 문자열 값으로 간주합니다.

특성이 없거나, 갑이 유효하지 않은 경우 부모 요소로부터 상속합니다. 즉, 부모 요소를 편집 가능한 경우 자신도 편집 가능합니다.

가능한 값에 truefalse가 있긴 하지만, contenteditable 특성은 불리언 특성이 아닌 열거형 특성입니다.

텍스트 삽입 시 표시되는 커서의 색은 CSS caret-color 특성으로 바꿀 수 있습니다.

명세

Specification Status Comment
HTML Living Standard
The definition of 'contenteditable' in that specification.
Living Standard No change from latest snapshot, HTML 5.1
HTML 5.2
The definition of 'contenteditable' in that specification.
Recommendation Snapshot of HTML Living Standard, no change from HTML 5.1
HTML 5.1
The definition of 'contenteditable' in that specification.
Recommendation Snapshot of HTML Living Standard, no change from HTML5
HTML5
The definition of 'contenteditable' in that specification.
Recommendation Snapshot of  HTML Living Standard, initial definition.

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
contenteditableChrome Full support YesEdge Full support 12Firefox Full support 3IE Full support 5.5Opera Full support 9Safari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
contenteditable="caret"
Experimental
Chrome Full support YesEdge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android Full support Yes
contenteditable="events"
Experimental
Chrome Full support YesEdge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android Full support Yes
contenteditable="plaintext-only"
Experimental
Chrome Full support YesEdge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android Full support Yes
contenteditable="typing"
Experimental
Chrome Full support YesEdge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

같이 보기