English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <input> autocomplete Attribute

The autocomplete attribute specifies whether the auto-complete feature should be enabled for the input field. The auto-complete feature allows the browser to predict values. When the user starts typing in the field, the browser should display options for filling in the field based on the earlier entered values.

 HTML <input> tag

Online Example

HTML form with auto-complete feature turned on (and turned off in an input field):

<!DOCTYPE html>
<html>
<head>
<title>HTML: <input> autocomplete Attribute - Basic Tutorial Website(oldtoolbag.com)</title>/title>
<body>
<form action="action_page.php" autocomplete="on">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  E-mail: <input type="email" name="email" autocomplete="off"><br>
  <input type="submit">
</form>
</body>
</html>
Test to see ‹/›
Fill out and submit the form, then reload the page to see how the auto-complete feature works.
Please note that the auto-complete feature is turned on for forms, while the auto-complete feature for email fields is turned off.

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the autocomplete attribute.

Tip:In some browsers, you may need to enable the auto-complete feature for it to work (check under "Preferences" in the browser menu).

Definition and Usage

The autocomplete attribute specifies whether the auto-complete feature should be enabled for the input field.

The auto-complete feature allows the browser to predict values. When the user starts typing in a field, the browser should display options for filling the field based on earlier entered values.

Note:The autocomplete attribute applies to the following <input> types: text, search, url, tel, email, password, datepickers, range, and color.

HTML 4.01 with HTML5difference

The autocomplete attribute is an HTML5 of the new attribute.

Syntax

<input autocomplete="on|off">

Attribute Value

ValueDescription
onDefault. Specifies enabling the auto-complete feature.
offSpecifies disabling the auto-complete feature.
 HTML <input> tag