The <input> tag with a type="month"
attribute creates a text field that accepts a month and year value.
Inside this field is a calendar icon. Clicking the icon opens a month/year picker.
An <input> element of type month.
Clicking the calendar icon opens a month/year picker. Alternatively, enter the month and year directly into the field.
<form action="/tutorial/action.html">
<fieldset>
<legend>Birth month/year</legend>
<input type="month" name="birthmonth"><br /><br />
<input type="submit" value="Submit">
</fieldset>
</form>
The <input type="month">
specifies a month and year picker.
Clicking the calendar icon opens the month/year picker.
The UI of this control varies from browser to browser. In addition, browser support is spotty.
The month field also accepts manual entry which follows a month/year format.
<input type="month">
Here is when type="month"
support started for each browser:
Chrome
|
25.0 | Feb 2013 |
Firefox
|
Not Supported | |
IE/Edge
|
12.0 | Jul 2015 |
Opera
|
10.1 | Jun 2009 |
Safari
|
Not Supported |
Back to <input>