HTML <input> autocomplete Attribute
Example
<form action="action.php" autocomplete="on">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname" autocomplete="off"><br>
<input type="submit">
</form>
Meaning
The autocomplete is Not a Boolean attribute is used to specifies whether or not the form field should be automatically filled in.
The default value is on. HTML5 also supports this attribute.
The autocomplete attribute for input elements indicates to the browser whether a value should or should not be autofilled when appropriate.
The autocomplete attribute works with the following input types:
<input type="text" /><input type="search" /><input type="url" /><input type="tel" /><input type="email" /><input type="password" /><input type="date" /><input type="datetime-local" /><input type="range" /><input type="color" />
Standard Syntax
HTML: <input autocomplete="on|off">
XHTML: <input autocomplete="on|off" />
Browser Support
This support information does not include support for other autocomplete values.
As described in detail below, many modern browsers ignore the off value on certain fields in certain cases intentionally in order to give the user more control over autofilling fields. One example is the use of password managers
Status
Advertisement
Attribute Values
| Value | Description |
|---|---|
| on | (Default)The autocomplete is on. |
| off | The autocomplete is off. |