THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Input URL autocomplete Property

Input URL Object Reference Input URL Object

Example

Set autocomplete in a URL field to off:

document.getElementById("myURL").autocomplete = "off";
Try it yourself »

Definition and Usage

The autocomplete property sets or returns the value of the autocomplete attribute in a URL field.

When autocomplete is on, the browser automatically complete values based on values that the user has entered before.

Tip: In some browsers you may need to activate an autocomplete function for this to work (Look under "Preferences" in the browser's menu).


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The autocomplete property is supported in all major browsers.

Note: The autocomplete property is not supported in Opera 12 and earlier versions.

Note: The <input type="url"> element is not supported in Internet Explorer 9 and earlier versions, or in Safari.


Syntax

Return the autocomplete property:

urlObject.autocomplete

Set the autocomplete property:

urlObject.autocomplete="on|off"

Property Values

Value Description
on Default. The browser will automatically complete values based on values that the user has entered before
off The user must enter a value into each URL field for every use. The browser does not automatically complete entries

Technical Details

Return Value: A String, representing the state of autocompletion

More Examples

Example

Return the state of autocompletion:

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

The result of x will be:

on
Try it yourself »

Related Pages

HTML reference: HTML <input> autocomplete Attribute


Input URL Object Reference Input URL Object