YouTip LogoYouTip

Prop Email Name

HTML DOM Input Email name Property

HTML DOM Input Email name Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

<input> - datetime-local

HTML DOM FileUpload Object

Input Email name Property

Input Email Object Reference Input Email Object

Example

Get the name of the email field:

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

x output will be:

usremail

Try it Β»


Definition and Usage

The name property sets or returns the value of the name attribute of an email field.

The name property is usually used to identify form data for submission to the server, or as a reference identifier for JavaScript on the client side.

Note: Only form fields with a name attribute will have their values passed when submitting a form.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The name property is supported in all major browsers.

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


Syntax

Return the name property:

emailObject.name

Set the name property:

emailObject.name=name

Property Values

Value Description
name Specifies the name of the email field

Technical Details

Return Value: A string, representing the name of the email field

More Examples

Example

Change the name of the email field:

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

Try it Β»


Related Pages

HTML Reference: HTML <input> name Attribute


Input Email Object Reference Input Email Object

← Prop Email ReadonlyProp Email Maxlength β†’