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.
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>
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"
.
<form autocomplete="on | off">
Value | Description |
---|---|
on | Use autocomplete. This is the default. |
off | Turn off autocomplete. |
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 |
Back to <form>