HTML
Example
A form with autocomplete enabled:
<form action="demo_form.html" method="get" autocomplete="on">First name:
<input type="text" name="fname">
<br>E-mail:
<input type="email" name="email">
<br>
<input type="submit" form>Try it »
Browser support
The numbers in the table indicate the first browser version that supports this property.
| property | |||||
|---|---|---|---|---|---|
| autocomplete | Yes | Yes | 4.0 | 5.2 | 15.0 |
Definition and Usage
The autocomplete attribute specifies whether a form should have autocomplete enabled.
Autocomplete allows the browser to predict the input to a field. When a user starts typing in a field, the browser should display options to fill in the field based on values typed previously.
To disable autocomplete for a form, you can set the autocomplete attribute to "off":
autocomplete="off"
**Tip:** autocomplete "on" applies to forms and "off" applies to specific input fields, and vice versa.
Differences between HTML 4.01 and HTML5
The autocomplete attribute is new in HTML5.
Syntax
Attribute values
| Value | Description |
|---|---|
| on | Default. Specifies that autocomplete is enabled. The browser will automatically complete values based on values previously typed by the user. |
| off | Specifies that autocomplete is disabled. The user must enter a value into each field every time, and the browser will not complete the input automatically. |
HTML tag