Latest web development tutorials

HTML DOM Input Month name attribute

Input Month Object Reference Input Month Object


Get month Field Name:

var x = document.getElementById("myMonth").name;
x The output is:

try it"

Definition and Usage

name attribute is used to set or return the property value month name field.

name attribute is typically used to server identifiers submitted form data, or the client as a Javascript reference identification.

Note: Only the name attribute is set, in the form submission to submit data to the server.

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute name

Note: Internet Explorer or Firefox browser does not support type = "month" <input> element attributes.


Returns the name attribute:

monthObject .name

Setting name attribute:

monthObject .name= name

Property Value

name 描述了 month 字段的名称

technical details

return value: String representing the name of the month field

More examples


Modify the name of month field:

document.getElementById("myMonth").name = "newMonthName";

try it"

Related Pages

HTML Reference Manual: HTML <the INPUT> name attribute

Input Month Object Reference Input Month Object