Input Email name Attribute

Definition and Usage

name Sets or returns the value of the name attribute of the email field.

The HTML name attribute is used to identify form data after the form data is submitted to the server, or to reference form data on the client side using JavaScript.

Note:Only form elements that have a name attribute will pass their values when the form is submitted.

See also:

HTML Reference Manual:HTML <input> name Attribute

Example

Example 1

Get the name of the email field:

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

Try it yourself

Example 2

Change the name of the email field:

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

Try it yourself

Syntax

Return the name attribute:

emailObject.name

Set name attribute:

emailObject.name = name

Attribute Value

Value Description
name Specifies the name of the email field.

Technical Details

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

Browser Support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 Support Support Support