Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input autocomplete attribute

HTML autocomplete property

HTML input Tag Reference HTML tag

Example

An HTML form with autocomplete enabled (one input field has autocomplete disabled):

<form action="demo_form.html" autocomplete="on">

First name:

<input type="text" name="fname">
<br>

Last name:

<input type="text" name="lname">
<br>

E-mail:

<input type="email" name="email" autocomplete="off">
<br>
<input type="submit" form>

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the autocomplete property.

**Tip:** In some browsers, you may need to enable autocomplete manually (set it in the browser menu's "Preferences").


Definition and Usage

The autocomplete attribute specifies whether an input field should have autocomplete enabled.

Autocomplete allows the browser to predict the input to a field. When the user starts typing in the field, the browser should display options to fill in the field based on previously typed values.

**Note:** The autocomplete attribute applies to the following types: text, search, url, tel, email, password, datepickers, range, and color.


Differences between HTML 4.01 and HTML5

The autocomplete attribute is new in HTML5.


Syntax

Attribute values

Value Description
on Default. Specifies that autocomplete is enabled.
off Specifies that autocomplete is disabled.

HTML input Tag Reference HTML tag