Input Email name Attribute
Example
Get the email field name:
var x = document.getElementById("myEmail").name;
usremail
Definition and Usage
The name attribute is used to set or return the value of the name attribute of an email field.
The name attribute is typically used as an identifier for submitting form data to the server or as a reference identifier in JavaScript on the client side.
Note: Only fields with the name attribute set can have their data submitted to the server after form submission.
Browser Support
All major browsers support the name attribute.
Note: Internet Explorer 9 (and earlier versions) or Safari do not support the HTML <input> element with type="email".
Syntax
Return the name attribute:
Set the name attribute:
Attribute Values
| Value | Description |
|---|---|
| name | Describes the name of the email field |
Technical Details
| Return Value: | String, representing the name of the email field | | --- | --- |
More Examples
Example
Change the name of the email field:
document.getElementById("myEmail").name = "newEmailName";
Related Pages
HTML Reference: HTML <input> name Attribute