HTML Attributes

HTML <form> autocomplete Attribute

The autocomplete attribute on a <form> sets the default autofill behaviour for all fields inside it.


The <form> autocomplete Attribute

When placed on the <form> element, autocomplete defines the default for every input, textarea and select in the form. Individual fields can still override this by setting their own autocomplete attribute, giving you form-wide control with per-field exceptions.

Syntax

ℹ️

Syntax: <form autocomplete="on"> or <form autocomplete="off">. The default is on when the attribute is not specified.

Turn off autofill for the whole form but re-enable one field
<form autocomplete="off">
  <input type="text" name="code" placeholder="One-time code">
  <input type="email" name="email" autocomplete="email">
</form>
ValueDescription
onFields may be autofilled by the browser (the default)
offThe browser should not autofill fields in this form by default
⚠️

Setting autocomplete="off" is only a hint. Browsers may ignore it for login and password fields to keep password managers working, so never rely on it for security.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships