Web4College

HTML autocomplete attribute

HTML autocomplete attribute suggests the input field values to fill automatically to facilitate the user.

Example
Try it
<p>By default autocomplete value is 'on'</p>
<p>Acount holder:<input type='text' name='aholder'></p>
<p>PIN:<input type='password' name='pin' autocomplete='off'></p>

By default autocomplete value is 'on'

Acount holder:

PIN:

By default, every element in a form hints the user different options.

But if the value of autocomplete attribute is set to off, then form does not give any hint for auto fill feature.

Attribute values

All possible values of autocomplete attribute

It is a boolean type attribute. The value of this attribute may be 'on' or 'off'.

The absence of autocomplete attribute means the autofill feature is on.

Related Tags

The tags that support autocomplete attribute

<form> tag

form tag represents a form to collect the data.

Example
Try it
<form action="address of file to process data" autocomplete="off"> </form>

<input> tag

input field also hints the user for auto fill feature. autofill feature of input control can be disabled individually.

Example
Try it
<input type="text" name="fname" autocomplete="off">

<textarea> tag

autocomplete attribute is also applicable on the textarea element.

Example
Try it
<p>change value of attribute from <b>off</b> to <b>on</b> to see the affect of autocomplete attribute.</p>
<textarea cols="20" rows="20" autocomplete="off"> </textarea>