← Chrome 152 reference

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 inChrome 152 (Enabled by default)
StatusEnabled by default
SpecHTML Living Standard §Autocorrection
Standards position (Firefox)Shipped/Shipping
Standards position (Safari)Shipped/Shipping
ChromeStatus6264645053710336 — Expose the autocorrect global HTML attribute
Source: chromestatus.com/feature/6264645053710336

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.

Source: chromestatus feature summary; HTML Living Standard

shape of the API

partial interface HTMLElement {
  [CEReactions] attribute boolean autocorrect;
};
PropertyTypeNotes
HTMLElement.prototype.autocorrectbooleanReflects the autocorrect content attribute. true = on; false = off

The property is a boolean reflection of the autocorrect content attribute. When reading, it returns true if the used autocorrection state is on and false if off. When writing, assigning true sets the content attribute to "on", and assigning false sets it to "off". Getting or setting the property does not throw runtime exceptions.

Source: HTML Living Standard §Autocorrection; html_element.idl

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

BrowserSupportNotes
Chrome 152+Enabled by defaultJS property now reflects the attribute
FirefoxShippedAlready reflected (bug 1927977)
SafariShippedAlready reflected (Safari 18.2)

Security and privacy: The autocorrect attribute and property control client-side input editing assistance (such as OS-level spelling correction and IME behavior) on editable elements. Exposing the reflection property does not introduce cross-origin data exposure or access elevated user privileges.

Source: chromestatus.com/feature/6264645053710336

see also