Input URL autocomplete property

Definition and Usage

autocomplete Set or return the value of the autocomplete property in the URL field.

After enabling autocomplete, the browser will automatically complete values based on the user's previous inputs.

Tip:In some browsers, you may need to enable the autocomplete feature to work properly (check under "Preferences" in the browser menu).

See also:

HTML Reference Manual:HTML <input> autocomplete Atribute

Example

Example 1

Set the autocomplete of the URL field to off:

document.getElementById("myURL").autocomplete = "off";

Try it yourself

Example 2

Return the autocomplete status:

var x = document.getElementById("myURL").autocomplete;

Try it yourself

Syntax

Return the autocomplete property:

urlObject.autocomplete

Set the autocomplete property:

urlObject.autocomplete = "on|off"

Attribute Value

Value Description
on Default. Browsers will automatically complete values based on the user's previous input.
off The user must enter a value in each URL field every time they use it. Browsers will not automatically complete entries.

Technical Details

Return Value: String value, representing the state of autocomplete.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported 10.0 Supported Not Supported Supported