English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML tag大全

HTML: <form> autocomplete attribute

The autocomplete attribute specifies whether the form should enable or disable the autocomplete feature. When the autocomplete feature is enabled, the browser will automatically complete the entry based on the user's previous input.

 HTML <form> tag

Online Example

Form with autocomplete feature enabled:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML form autocomplete attribute usage-Basic Tutorial(oldtoolbag.com)</title>
</head>
<body>
<form action="action_page.php" method="get" autocomplete="on">
  First name:<input type="text" name="fname"><br>
  E-mail: <input type="email" name="email"><br>
  <input type="submit">
</form>
<p>Fill in and submit the form, then reload the page and start filling out the form again-And check the working principle of autocomplete. Then, try setting the autocomplete feature to 'off'.</p>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Except for Opera, all major browsers support the autocomplete attribute.

Definition and Usage

The autocomplete attribute specifies whether the form should enable or disable the auto-complete feature.
After enabling the autocomplete feature, the browser will automatically fill in the form based on the user's previous entries.
Tip: You can set the form's 'auto-complete' to 'on' and the auto-complete of a specific input field to 'off', and vice versa.

HTML 4.01 between5difference

The autocomplete attribute is an HTML5 of the new attribute.

Syntax

<form autocomplete="on|off">

Attribute Value

ValueDescription
onDefault. Specifies that the auto-complete feature is enabled. The browser will automatically complete values based on the user's previous entries.
offSpecifies that the auto-complete feature is disabled. Users must enter values into each field every time they use it, and the browser will not automatically complete the input.
 HTML <form> tag