Input Month name Property
Example
Get the name of the month field:
var x = document.getElementById("myMonth").name;
x
The output is:
bdaymonth
Try it »
Definition and Usage
The name property is used to set or return the value of the name attribute of the month field.
The name attribute is typically used as the identifier for submitting form data to the server, or as a reference identifier for JavaScript on the client side.
**Note:** Only after setting the name attribute can data be submitted to the server upon form submission.
Browser support





All major browsers support the name attribute
**Note:** Internet Explorer or Firefox browsers do not support the HTML using the type="month" attribute .
Syntax
Return the name attribute:
monthObject
.name
Set the name attribute:
monthObject
.name=
name
Attribute values
| Value | Description |
|---|---|
| name | Describes the name of the month field |
Technical Details
| Return Value: | String, representing the name of the month field |
|---|
More examples
Example
Modify the name of the month field:
document.getElementById("myMonth").name = "newMonthName";
Try it »
Related pages
HTML Reference Manual: HTML name attribute
Input Month Object