Dofactory.com
Dofactory.com

HTML <form> autocomplete Attribute

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

This attribute affects <select>, <textarea>, and <input> controls of type: text, search, URL, email, password, date pickers, range, and color.

Example

#

A <form> with an autocomplete value of on.
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 that all form elements can be autofilled.

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

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>

Last updated on Sep 30, 2023




Guides