Input Email size property
Example
Modify the width of the email field:
document.getElementById("myEmail").size = "50";
Try it »
Definition and Usage
The size property is used to set or return the value of the size attribute of the email field.
The size property describes the length of the email field (number of characters).
The default value is 20.
Tip: To set or return the maximum number of the email field, you can use maxLength attribute.
Browser support





All major browsers support the size property
Note: Internet Explorer 9 (and earlier IE versions) or Safari browser does not support the HTML element with type="email". .
Syntax
Return the size property:
emailObject
.size
Set the size property:
emailObject
.size=
number
Attribute values
| Value | Description |
|---|---|
| number | Describes the length of the email field, i.e. the number of characters. The default value is 20 |
Technical Details
| Return Value: | Number, representing the length of the email field, i.e. the number of characters. |
|---|
More examples
Example
Display the length of the email field (number of characters):
var x = document.getElementById("myEmail").size;
x
The output is:
30
Try it »
Related pages
HTML reference: HTML size property
Input Email Object