Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Month name Property

Input Month name Property

Input Month Object Reference Input Month Object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 Reference Input Month Object