Input Month nameProperty

Input Month 对象参考手册Input Month Object

Example

Get the name of the month field:

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

Try it yourself »

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 usually used as an identifier for 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 after form submission.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name attribute

Note:Internet Explorer and Firefox do not support <input> elements with the type="month" attribute.


Syntax

Return the name property:

monthObject.name

Set the name property:

monthObject.name=name

Property Values

Value Description
name Describes the name of the month field

Technical Details

Return value: A 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 yourself »


Related Pages

HTML Reference Manual:HTML <input> name attribute


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