The autocomplete attribute specifies which element, <form> or <input>, should have autocomplete option enabled.

If the autocomplete attribute is enabled, the browser will try to complete fields with the previously entered values. Usually a browser starts auto-filling the fields when a user starts typing.

If a <form> element has autocomplete enabled, we are still allowed to opt out specific <input> element(s) inside of it.

The <input> types that accept autocomplete attribute are:


<input type=”” name=”” autocomplete=”on” />


The autocomplete attribute values may be:

  • on or off
NOTE: The default value is ON and if the autocomplete attribute stays omitted, the browser will be suggesting values based on the inputs.


The autocomplete attribute example:


›› go to examples ››