X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Form autocomplete Property

Form Object Reference Form Object

Example

Set autocomplete to off:

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

Try it yourself »


Definition and Usage

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

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

Tip: It is possible to have autocomplete "on" for the form, and "off" for specific input fields, or vice versa.


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.


Syntax

Return the autocomplete property:

formObject.autocomplete

Set the autocomplete property:

formObject.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 field for every use. The browser does not automatically complete entries

Technical Details

Return Value: A String, representing the state of autocompletion (whether the input field should give the user some suggestion during typing or not)


More Examples

Example

Return the state of autocompletion:

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

The result of x will be:

on

Try it yourself »


Related Pages

HTML reference: HTML <form> autocomplete attribute


Form Object Reference Form Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook