Input Email nameProperty

Input Email 对象参考手册Input Email Object

Examples

Get the email field name:

var x = document.getElementById("myEmail").name;
xThe output result is:
usremail

Try it Yourself »

Definition and Usage

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

The name attribute is usually used as an identifier when submitting form data to the server, or as a reference identifier for JavaScript on the client side.

Note:Only when the name attribute is set can data be submitted to the server when the form is submitted.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All mainstream browsers support the name attribute.

Note:Internet Explorer 9 (and earlier IE versions), or Safari, do not support HTML <input> elements with type="email".


Syntax

Return the name property:

emailObject.name

Set the name property:

emailObject.name=name

Property Values

Value Description
name Describes the name of the email field.

Technical Details

Return value: A string, representing the name of the email field.


More Examples

Example

Modify the name of the email field:

document.getElementById("myEmail").name = "newEmailName";

Try it Yourself »


Related Pages

HTML Reference:HTML <input> name Attribute


Input Email 对象参考手册Input Email Object Other Extensions