YouTip LogoYouTip

Prop Month Name

HTML DOM Input Month name Property

HTML DOM Input Month name Property

-- Learning is not just about technology, it's about dreams!

JavaScript Reference

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

<input> - image

<input> - number

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 output will be:

bdaymonth

Try it yourself Β»


Definition and Usage

The name property sets or returns the value of the name attribute of a month field.

The name attribute is typically used as an identifier when submitting form data to a server, or as a reference identifier for JavaScript on the client side.

Note: Only form fields with a name attribute will have their values passed when submitting a form.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The name property is supported in all major browsers.

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


Syntax

Return the name property:

monthObject.name

Set the name property:

monthObject.name=name

Property Values

Value Description
name Specifies the name of the month field

Technical Details

Return Value: A String, representing the name of the month field

More Examples

Example

Change the name of the month field:

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

Try it yourself Β»


Related Pages

HTML Reference: HTML <input> name attribute


Input Month Object Reference Input Month Object

← Prop Month ReadonlyProp Month Form β†’