Input URL autocomplete attribute
Definition and Usage
autocomplete
Set the attribute or return the value of the autocomplete attribute 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 make it work properly (check under "Preferences" in the browser menu).
See also:
HTML Reference Manual:HTML <input> autocomplete Attribute
Example
Example 1
Set the autocomplete of the URL field to off:
document.getElementById("myURL").autocomplete = "off";
Example 2
Return the status of autocomplete:
var x = document.getElementById("myURL").autocomplete;
Syntax
Return the autocomplete attribute:
urlObject.autocomplete
Set the autocomplete attribute:
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: | A string value that represents the state of autocomplete. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supported | 10.0 | Supported | Not Supported | Supported |