Latest web development tutorials

HTML input autocomplete attribute

HTML input Tag Reference HTML <input> tag


Enable AutoComplete feature of HTML forms (one input field is disabled automatically):

<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">

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support autocomplete attribute.

Tip: In some browsers, you may need to manually enable the AutoComplete feature (set in the "Preferences" menu in your browser).

Definition and Usage

autocomplete attribute specifies whether the input field should enable the AutoComplete feature.

Automatically allows the browser to predictive input field. When users start typing in the field, based on the browser before typing over the value of the option should be displayed in the field to fill.

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

Differences between HTML 4.01 and HTML5

autocomplete attribute is new in HTML5 attributes.


<input autocomplete="on|off">

Property Value

on 默认。规定启用自动完成功能。
off 规定禁用自动完成功能。

HTML input Tag Reference HTML <input> tag