Advertisement
Home Open Editor ❯

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>

Try this code ❯

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>

Try this code ❯

Meaning

The autocomplete attribute specifies whether a form or an input field should be autocompleted or not.


Standard Syntax

<element autocomplete="on|off">


Applies to:

The autocomplete attribute can be used on the following element:


Advertisement

Attribute Values

Value Description
on (default) The browser may automatically complete entries.
off The browser will not automatically complete entries.
Home Open Editor ❯
Advertisement