HTML <form> autocomplete attribute

Definition and Usage

autocomplete The attribute specifies whether the form should enable the automatic completion feature.

After enabling the automatic completion feature, the browser will automatically complete the input based on the user's previous input values.

Tip: You can enable the automatic completion feature of the form and disable the automatic completion feature of specific input fields, or vice versa.

Example

Enable automatic completion form:

<form action="/action_page.php" method="get" autocomplete="on">
  <label for="fname">Name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="email">Email:</label>
  <input type="text" id="email" name="email"><br><br>
  <input type="submit">
</form>

Try It Yourself

Syntax

<form autocomplete="on|off">

Attribute Value

Value Description
on Default. Browsers will automatically complete the input based on the values previously entered by the user.
off Users must enter a value for each field every time they use it. Browsers will not automatically complete the input.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported Supported 4.0 5.2 15.0

Note: The autocomplete attribute is a new attribute in HTML5.