← 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

PropertyTypeNotes
HTMLElement.prototype.autocorrectbooleanReflects 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.

Source: HTML Living Standard §Autocorrection

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
SafariShippedAlready reflected
Source: chromestatus.com/feature/6264645053710336

see also