autocomplete attribute | autocomplete property
Specifies whether autocomplete is applied to an editable text field.
This property is read/write.
![]() |
Syntax
| HTML |
|---|
<element autocomplete="sAutocompleteState" ... > |
| JavaScript |
|---|
object.autocomplete = sAutocompleteState sAutocompleteState = object.autocomplete |
Property values
Type: DOMString
A string containing whether autocomplete is on or off.
| Value | Condition |
|---|---|
|
Turns autocomplete on. |
|
Turns autocomplete off. |
Remarks
If the autocomplete attribute is missing, the field will default to an "on" state if element has no parent form, or if the form has autocomplete set to "on".
Examples
The following example uses the autocomplete attribute to disable autocomplete on a text field.
<input type="text" autocomplete="off">
See also
Show:
