The autocomplete attribute on a <select> tag specifies that the select element is autocompleted with a previously selected option.
This attribute suggests values based on previously entered values by the user.
An autocomplete attribute on a <select> tag.
<form action="/tutorial/action.html">
<select name="color" autocomplete="on">
<option value="">-- Select Color --</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select> <br />
<button type="submit">Submit</button>
</form>
The autocomplete attribute specifies that the control uses autocomplete.
With autocomplete on, the browser sets select values based on what the user entered before.
Most browsers intentionally ignore autocomplete="off"
.
<select autocomplete="on | off">
Value | Description |
---|---|
on | Enables autocomplete in select field. |
off | Disables autocomplete in select 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 |