autocorrect
The autocorrect global HTML attribute controls whether to automatically correct spelling or punctuation errors for user input. It is most useful when native HTML semantics or browser capabilities can replace custom implementation work.
Overview
The autocorrect global HTML attribute controls whether to automatically correct spelling or punctuation errors for user input. It is most useful when native HTML semantics or browser capabilities can replace custom implementation work.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| | | 136 | 14.1 | | 14.5 | |
| DOM API | ||||||
| The autocorrect property of the HTMLElement interface controls whether or not autocorrection of editable text is enabled for spelling and/or punctuation errors. | | | 136 | 14.1 | | 14.5 |
Syntax
<input type="text" autocorrect="off" placeholder="コード入力">
<textarea autocorrect="on">Standard text input</textarea> Live demo
Writing versus code
Keep autocorrect on for prose and off for usernames, tags, or code-like input.
Editable note board
Compare autocorrect support in two editable surfaces with different writing goals.
Use cases
Use autocorrect
Use autocorrect when standard HTML needs a more specific platform feature, semantic signal, or browser capability.
Handle edge cases
Apply autocorrect to solve a focused requirement without redesigning the whole page architecture.
Cautions
- Test autocorrect in your target browsers and input environments before depending on it as a primary behavior.
- Provide a fallback path or acceptable degradation strategy when support is still limited.
Accessibility
- Make sure autocorrect supports the intended task without making the page harder to perceive, understand, or operate.
Related links
Powered by web-features