contenteditable="plaintext-only"Baseline · Newly available
The contenteditable="plaintext-only" global HTML attribute allows the user to edit the content of an element, but prevents rich-text formatting.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Mar 4, 2025.
Browser support
DesktopChrome
1–50Not supported
51+Supportedsince May 25, 2016
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–135Not supported
136+Supportedsince Mar 4, 2025
Current: 157Safari
1–5Not supported
5.1+Supportedsince Jul 20, 2011
Current: 27MobileChrome Android
18–50Not supported
51+Supportedsince Jun 8, 2016
Current: 155Firefox Android
4–135Not supported
136+Supportedsince Mar 4, 2025
Current: 157Safari iOS
1–4.2Not supported
5+Supportedsince Oct 12, 2011
Current: 27How to use
Every current browser supports this, but it only became Baseline on Mar 4, 2025. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN — see the links below.
Feature detection
JS · check before using
if ("HTMLElement" in globalThis && "contentEditable" in HTMLElement.prototype) {
// HTMLElement.contentEditable is available
}Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLElement.contentEditable.plaintext-only | 51 | 12 | 136 | 5.1 | 51 | 136 | 5 |
| contenteditable.plaintext-only | 51 | 12 | 136 | 5 | 51 | 136 | 4.2 |