Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

autocomplete

Tells the browser which saved data to fill into a field.

Syntax

<input name="email" autocomplete="email">

Parameters

ParameterTypeDescription
autocompleteon | off | name | email | tel | street-address | new-password | one-time-code | …What data the field holds — the browser uses it to fill in saved values.

Examples

A delivery form with autofill:

<form>
  <p><input name="name" autocomplete="name" placeholder="Full name"></p>
  <p><input name="email" type="email" autocomplete="email" placeholder="Email"></p>
  <p><input name="address" autocomplete="street-address" placeholder="Address"></p>
  <p><input name="code" autocomplete="one-time-code" inputmode="numeric" placeholder="SMS code"></p>
</form>

Notes

Precise values save users time, especially on phones. For a new password field write new-password — the browser will offer to generate a strong one. Browsers often ignore off for logins and passwords.

See also

  • <input> — An input field; its kind is set by the `type` attribute.
  • <form> — A form: collects data from its fields and sends it to the server.
  • type — The kind of an `<input>` field: from text and numbers to a date, colour and file.

Related recipes

In the tutorial

  • Forms — How a form works in HTML — the form tag, the input field, the name attribute, the submit button, action and the GET and POST methods.

Thanks for reading!

Donate to the site — we work hard for you.