HTML <form> autocomplete Attribute

The autocomplete attribute on a <form> tag specifies that all child input elements are autofilled with previously entered values.

Example

#

An autocomplete attribute on a <form> element.
All input fields in the form have autocomplete enabled.

<form action="/tutorial/action.html" autocomplete="on">
  <input type="text" name="firstname" placeholder="First name">
  <input type="text" name="lastname" placeholder="Last name">

  <button type="submit">Submit</button>
</form>

Using autocomplete

The autocomplete attribute specifies to the browser that the form elements can be autofilled.

When autocomplete is on, the browser provides input values based on previous values the user has entered.

This attribute only works with textarea, select, and input controls of type: text, search, URL, email, password, date pickers, range, and color.

Most browsers intentionally ignore autocomplete="off".


Syntax

<form autocomplete="on | off">

Values

#

Value Description
on Use autocomplete. This is the default.
off Turn off autocomplete.

Browser support

Here is when autocomplete support started for each browser:

Chrome
1.0 Sep 2008
Firefox
4.0 Mar 2011
IE/Edge
1.0 Aug 1995
Opera
15.0 May 2013
Safari
5.2 Sep 2013

You may also like

 Back to <form>
Guides