HTML autocomplete Attribute
The autocomplete attribute with an <input> element.
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>
The autocomplete attribute with an <input> element.
Example
<form action="action.php" method="get" 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"><br>
<input type="submit" value="Submit">
</form>
Meaning
The autocomplete attribute specifies whether a form or an input field should be autocompleted or not.
Standard Syntax
<element autocomplete="on|off">
Browser Support
Status
Applies to:
The autocomplete attribute can be used on the following element:
Element | Attribute |
---|---|
<form> | autocomplete |
<input> | autocomplete |
Attribute Values
Value | Description |
---|---|
on | (default) The browser may automatically complete entries. |
off | The browser will not automatically complete entries. |