First name:
Last"> First name:
Last" />
Easy Tutorial
❮ Tag Title Tag Embed ❯

HTML <input> autocomplete Attribute

HTML <input> Tag

Example

An HTML form with autocomplete enabled (one input field has autocomplete disabled):

<form action="demo_form.html" 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>

Browser Support

All major browsers support the autocomplete attribute.

Tip: In some browsers, you may need to manually enable autocomplete (set in the browser menu under "Preferences").


Definition and Usage

The autocomplete attribute specifies whether a form or input field should have autocomplete enabled.

Autocomplete allows the browser to predict the value of a field. When a user starts typing in a field, the browser should display options to fill in the field based on earlier typed values.

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


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.
off Specifies that autocomplete is disabled.

❮ Tag Title Tag Embed ❯