HTML5 Month Input Type

The month type is used to specify the particular month and year by the user. The month type is used in <input> tag. It only specifies the month and year and not the date. To specify the complete date we can use date input type. One example is the credit card expiry date where only month and year is displayed.

Syntax month Input Type

<input type= “month”>

Browser Support

month type is supported by Chrome, Safari and Opera.

HTML5 date Input Type Example

<!DOCTYPE html>
<title>Month Input Type</title>
		Your card expires on:<input type="month">

  • In this program we have shown how to take month and year in the form.
  • In this program we are setting month and year using the month type in input tag.

Example Application Test

  • Save the file as month_example.html in your system.
  • Just open the file in the browser, you will see the below picture in the browser. Note that the browser must support HTML5 specification.


When the execution process is completed successfully we will get the following output:
HTML5 Month Input Type

Something like this:


Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This

Share this post with your friends!