A form can ask for information a person has already entered elsewhere, such as a name or email address. The autocomplete attribute tells the browser what a field is for so it can offer stored information when available. This can reduce typing effort and input errors. section 6.1.8 section 6.1
Choose a value for the field’s purpose, not just its data type. An input type can identify a date, for example, but does not distinguish a birthday from a credit-card expiry date. For a person’s name, use autocomplete="name" alongside an appropriate input type and a visible label. section 6.1.8 section 6.1.10
A name field
<label for="owner-name">Owner’s name</label> <input id="owner-name" name="owner_name" type="text" autocomplete="name"> section 6.1.10
When a form asks for similar information in different contexts, identify the context too. Shipping and billing postal-code fields, for instance, can use autocomplete="shipping postal-code" and autocomplete="billing postal-code". Separate sections can distinguish repeated fields for different people. section 6.1.8
<input autocomplete="shipping postal-code"> <input autocomplete="billing postal-code">
Compare the shipping and billing values when two postal-code fields serve different purposes. section 6.1.8
Authentication fields need the same care. Use autocomplete="username" and autocomplete="current-password" for a login, and autocomplete="new-password" for a new password. These values help the browser fill stored credentials or, depending on the browser, offer help generating a new password rather than filling an existing one. section 7.3.1
