Use the autocomplete attribute for fields that collect user data.

input fields with autocomplete attribute
Figure 1 Example of input fields where autocomplete attribute is used

The autocomplete attribute is an HTML attribute that can be used to control the behavior of a form input element when a user types into it.

It allows developer to specify whether the browser's autocomplete feature should be enabled for that input field. In HTML 5.2, the autocomplete attribute also supports a variety of tokens that allow developers to provide more specific instructions to the browser about how to autocomplete the input field.


  • New to accessibility or uncertain of requirements, it will be helpful to review all sections below.
  • Already familiar with requirements, skip to the “Working Example” section for sample HTML, CSS and JavaScript (when needed), along with a working demo.