Latest web development tutorials

HTML DOM Input Email maxLength property

Input Email Object Reference Input Email Object

Examples

Get email field allows the maximum number of characters filled in:

var x = document.getElementById ( "myEmail") maxLength.;
x The output is:
30

try it"

Definition and Usage

maxLength attribute is used to set the maxlength attribute value or return email field.

maxLength attribute describes the maximum number of characters allowed in the email field.

The default value is 524288.

Tip: Set or return email field length, and number of characters, please use the size property.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support maxLength property.

Note: Internet Explorer 9 (and earlier versions of IE), or Safari browser does not support type = "email" in the HTML <input> elements.


grammar

Back maxLength attributes:

emailObject .maxLength

Setting maxLength properties:

emailObject .maxLength = number

Property Value

value description
number It describes the email field allows to fill the maximum number of characters. The default value is 524288

technical details

return value: Number that is allowed to fill in the email field to do more than the number of characters.


More examples

Examples

Setting email field allows the maximum number of characters filled in:

document.getElementById ( "myEmail") maxLength = "8".;

try it"


Related Pages

HTML Reference Manual: HTML <the INPUT> MAXLENGTH property


Input Email Object Reference Input Email Object