Latest web development tutorials

HTML DOM Input Email size property

Input Email Object Reference Input Email Object

Examples

Modify the width of the email field:

document.getElementById ( "myEmail") size = "50".;

try it"

Definition and Usage

size property sets or returns the property value email size field.

size attribute describes the length of the email field (number of characters).

The default value is 20.

Tip; If you want to set or return the maximum number of email field, you can use the maxLength property.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the size attribute

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


grammar

Returns size properties:

emailObject .size

Set size properties:

emailObject .size = number

Property Value

value description
number Describes the length of the email field, the number of characters. The default value is 20

technical details

return value: Number that represents the length of the email field, and the number of characters.


More examples

Examples

Display email field length (number of characters):

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

try it"


Related Pages

Reference the HTML: the HTML <the INPUT> size attributes


Input Email Object Reference Input Email Object