v152 · html · forms · javascript
Expose the autocorrect global HTML attribute
Chrome 152 exposes autocorrect as a reflected JavaScript property on HTMLElement, making it read/write from script just like autocomplete or spellcheck. Firefox and Safari already ship this.
at a glance
| Shipped in | Chrome 152 (Enabled by default) |
|---|---|
| Status | Enabled by default |
| Spec | HTML Living Standard §Autocorrection |
| Standards position (Firefox) | Shipped/Shipping |
| Standards position (Safari) | Shipped/Shipping |
| ChromeStatus | 6264645053710336 — Expose the autocorrect global HTML attribute |
why it exists
The HTML autocorrect content attribute has existed in browsers for years, but Chrome did not expose it as a JavaScript property on HTMLElement. This meant that code like input.autocorrect = 'off' silently did nothing in Chrome, even though the HTML attribute <input autocorrect="off"> worked. Firefox and Safari already reflected the attribute, so Chrome was the interop outlier.
Chrome 152 adds the IDL attribute, making autocorrect behave like other reflected boolean/string HTML attributes: setting it in JavaScript updates the content attribute and vice versa.
shape of the API
| Property | Type | Notes |
|---|---|---|
HTMLElement.prototype.autocorrect | boolean | Reflects the autocorrect content attribute. true = on; false = off |
The property is a boolean reflection of the autocorrect attribute — "" / "on" map to true; "off" maps to false.
example
const input = document.querySelector('input[name="username"]');
// Read the attribute via JS property (Chrome 152+)
console.log(input.autocorrect); // false (attribute says "off")
// Write via JS property
input.autocorrect = false; // adds autocorrect="off"
input.autocorrect = true; // removes the attribute / sets to "on"
// Equivalent HTML
// <input autocorrect="off"> → input.autocorrect === false
// <input> → input.autocorrect === true (default on)
// Dynamic form builder
function buildCodeField(container) {
const ta = document.createElement('textarea');
ta.autocorrect = false; // Chrome 152+, Firefox, Safari
ta.autocapitalize = 'none';
ta.spellcheck = false;
container.append(ta);
return ta;
}
Source: HTML Living Standard §Autocorrection
browser support
| Browser | Support | Notes |
|---|---|---|
| Chrome 152+ | Enabled by default | JS property now reflects the attribute |
| Firefox | Shipped | Already reflected |
| Safari | Shipped | Already reflected |