The autocomplete attribute on an <input> tag presents previously entered values as dropdown options to an input element.
This attribute only works with <input> controls of type: text, search, URL, email, password, date pickers, range, and color.
An autocomplete attribute on 3 <input> elements.
<form action="/tutorial/action.html">
<input type="text" autocomplete="on" name="firstname" placeholder="First name"><br /><br />
<input type="text" autocomplete="on" name="lastname" placeholder="Last name"><br /><br />
<input type="text" autocomplete="on" name="email" placeholder="Email"><br /><br />
<button type="submit">Submit</button>
</form>
With autocomplete on, the browser completes input values based on what the user entered before.
Most browsers intentionally ignore autocomplete="off"
.
<input autocomplete="on | off">
Value | Description |
---|---|
on | Enables autocomplete on input field. |
off | Disables autocomplete on input field. |
Here is when autocomplete support started for each browser:
Chrome
|
17.0 | Feb 2012 |
Firefox
|
2.0 | Oct 2006 |
IE/Edge
|
6.0 | Aug 2001 |
Opera
|
10.0 | Oct 2009 |
Safari
|
5.1 | Oct 2011 |