Latest web development tutorials

HTML DOM Input Month name attribute

Input Month Object Reference Input Month Object

Examples

Get month Field Name:

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

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.


grammar

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

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