Input Email autocompleteProperty

Input Email 对象参考手册Input Email Object

Examples

Set the autocomplete attribute of the email field to off:

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

Try it Yourself »


Definition and Usage

The autocomplete attribute is used to set or return the value of the autocomplete attribute of the email field.

When autocomplete is on, the browser automatically completes input based on values the user has entered before.

Tip:In some browsers, you may need to activate the autocomplete function to achieve this effect.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the autocomplete attribute.

Note:Opera 12 and earlier versions of browsers do not support the autocomplete attribute.

Note:Internet Explorer 9 and earlier IE versions, and Safari browsers do not support the <input type="email"> element.


Syntax

Return the autocomplete attribute:

emailObject.autocomplete

Set the autocomplete attribute:

emailObject.autocomplete="on|off"

Property Values

Value Description
on Default. Enables automatic input completion based on values the user has entered before.
off Disables the autocomplete function; the user needs to enter the value manually each time.

Technical Details

Return value: A string representing the autocomplete status


More Examples

Example

Get the autocomplete status:

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

xThe output result is:

on

Try it Yourself »


Related Pages

HTML Reference Manual:HTML <input> autocomplete attribute


Input Email 对象参考手册Input Email Object

Other Extensions