HTML Attributes
HTML <input> autocomplete Attribute
The autocomplete attribute controls whether the browser may automatically fill in an input's value.
The <input> autocomplete Attribute
The autocomplete attribute tells the browser whether, and how, it should help fill in a form field using previously stored values. On <input>, <textarea> and <select>, it accepts on, off, or specific tokens that describe the expected data so the browser can autofill accurately.
Syntax
ℹ️
Syntax: <input autocomplete="token">. The value is on, off, or a standard token such as email, name, tel or street-address.
<input type="text" name="fullname" autocomplete="name">
<input type="email" name="email" autocomplete="email">
<input type="password" name="new-pass" autocomplete="new-password">| Value | Description |
|---|---|
| on | Allow the browser to autofill this field (default behaviour) |
| off | Disable autofill, e.g. for sensitive or one-off fields |
| name | Full name |
| Email address | |
| tel | Telephone number |
| new-password | A new password, hinting password managers to suggest one |
💡
Use meaningful tokens rather than off wherever possible. Correct tokens improve accessibility and speed up form completion for users on mobile devices.
