First name:
E-mail: First name:
E-mail:
Easy Tutorial
❮ Tag Footer Canvas Linejoin ❯

HTML <form> autocomplete Attribute

HTML <form> Tag

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>

Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Attribute
autocomplete Yes Yes 4.0 5.2 15.0

Definition and Usage

The autocomplete attribute specifies whether a form should have autocomplete on or off.

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.

To disable form autocomplete, you can set the autocomplete attribute to "off":

autocomplete="off"

Tip: autocomplete "on" is for forms, and "off" is for specific input fields, or 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 autocomplete values based on values that the user has entered before.
off Specifies that autocomplete is disabled. The user must enter a value into each field for every use, and the browser does not autocomplete the entries.

❮ Tag Footer Canvas Linejoin ❯