v150 · HTML · Input
autocorrect global HTML attribute
Chrome 152 exposes the autocorrect HTML attribute as a global attribute, enabling web authors to control whether OS-level autocorrection should be applied to user input in editable elements — <input>, <textarea>, and contenteditable — using a simple boolean attribute.
concepts
-
Autocorrect Demo
Side-by-side comparison: one textarea with
autocorrect="on"and one withautocorrect="off". Type common misspellings and see the difference in correction behaviour on mobile/desktop systems. -
Element Types Comparison
Shows the
autocorrectattribute applied to all supported element types — text inputs, textarea, contenteditable — and explains which use cases call for autocorrect on vs off. -
Form Field Matrix
A reference table mapping every common form field type to its recommended
autocorrectsetting with the reasoning — prose and display names needon, usernames, code editors, URLs, and API keys needoff. Live input fields let you type into each and feel the difference. -
Inheritance Tester
The
autocorrectattribute inherits down the DOM tree from ancestors to editable descendants. Test the inheritance chain live: set the attribute on a<form>,<fieldset>, or intermediate<div>and watch all child elements adopt it unless they override it. -
JS API Inspector
Chrome 152 also exposes
element.autocorrectas a writable IDL property. Select any element, read its current IDL value, set it programmatically, or callremoveAttribute— and see the exact JavaScript code to reproduce each operation. A batch table shows the IDL vs attribute state for all elements simultaneously. -
Shadow DOM Scope
autocorrectinheritance crosses shadow DOM boundaries: a host element withautocorrect="off"passes the inherited value into its shadow root's editable children, just as it does for light DOM children. Toggle the host attribute and watch both light DOM and shadow DOM inputs update their effective value. Shadow components can still override with an explicit attribute inside the shadow root.
why it shipped
Safari has supported autocorrect="off" on inputs for many years. Chrome 152 adds the attribute to align with Safari, Firefox, and the HTML spec. Before Chrome 152, disabling autocorrect required workarounds like autocomplete="off" (which affects a different thing) or hacks targeting OS-level IME settings. Now autocorrect="off" is a clean, spec-compliant way to disable OS autocorrection.
the API
<!-- Enable autocorrect (default in most contexts) -->
<textarea autocorrect="on"></textarea>
<!-- Disable autocorrect -->
<input type="text" autocorrect="off">
<!-- contenteditable -->
<div contenteditable="true" autocorrect="off"></div>
<!-- Inherits on child elements -->
<form autocorrect="off">
<!-- All inputs in this form won't autocorrect -->
<input type="text">
<textarea></textarea>
</form>
<!-- JavaScript access -->
<script>
const input = document.querySelector('input');
input.autocorrect; // "on" | "off"
input.autocorrect = 'off';
</script>