Latest web development tutorials

HTML form autocomplete attribute

Tag Reference HTML form HTML <form> tag

Examples

Enable AutoComplete feature of forms:

<form action="demo_form.html" method="get" autocomplete="on">
First name:<input type="text" name="fname"><br>
E-mail: <input type="email" name="email"><br>
<input type="submit">
</form>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

In addition to Opera, the other major browsers support autocomplete attribute.


Definition and Usage

Autocomplete attribute specifies whether the form 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.

Tip: autocomplete "on" suitable form, "off" for a particular input field, and vice versa.


Differences between HTML 4.01 and HTML5

autocomplete attribute is new in HTML5 attributes.


grammar

<form autocomplete="on|off">

Property Value

描述
on 默认。规定启用自动完成功能。浏览器会基于用户之前键入的值自动完成值。
off 规定禁用自动完成功能。用户必须在每次使用时输入值到每个字段中,浏览器不会自动完成输入。


Tag Reference HTML form HTML <form> tag