HTML autocorrect Global Attribute
Description
The autocorrect attribute is a global HTML attribute used to control whether the browser or device should automatically correct text input in certain elements, typically <input> or <textarea>. It is primarily intended for touch-based devices, like smartphones and tablets, where software keyboards often offer automatic spelling correction. While autocorrect is not part of the official HTML specification, it is widely supported on mobile browsers (especially iOS Safari).
Purpose
The attribute allows web developers to enable or disable automatic text corrections, giving users the freedom to either rely on the device’s spelling suggestions or type freely without interference. This can be useful for fields like usernames, passwords, code snippets, or specialized terminology where autocorrection could be disruptive.
Usage
The autocorrect attribute can be added to any HTML element that accepts user input, including:
<input type="text"><input type="search"><textarea>
Example
<form>
<!-- Autocorrect enabled (default behavior on some devices) -->
<label for="note">Notes:</label>
<textarea id="note" name="note" autocorrect="on"></textarea>
<!-- Autocorrect disabled -->
<label for="username">Username:</label>
<input type="text" id="username" name="username" autocorrect="off">
</form>
In this example:
- The
textareafornoteallows the device to suggest and automatically correct spelling errors. - The
inputforusernamedisables autocorrection, which is important for usernames that may contain unusual characters or capitalization.
Notes
- The attribute is case-insensitive, meaning
"on"and"ON"behave the same. - It is often used alongside other text input attributes like
spellcheck="true"orautocompleteto create a more controlled input experience. - Not all devices respect the
autocorrectsetting, so behavior may vary slightly between browsers and platforms.
Syntax
<element autocorrect="value">
Values
- onThe browser or device should automatically correct spelling mistakes and apply autocorrections where appropriate.
- offDisables autocorrection, allowing the user to type exactly what they input without automatic modifications.
Example
Browser Support
The following information will show you the current browser support for the HTML autocorrect global attribute. Hover over a browser icon to see the version that first introduced support for this HTML global attribute.
This global attribute is supported in some modern browsers, but not all.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 26th December 2025
