HTML <input type=”month”>

The HTML <input type=”month”> element creates a month picker, allowing users to select a specific month and year without specifying a day. It provides a standardized way to input month-based data to enhance user experience.

Syntax

<input type="month"> 

Example: This example demonstrate the use of HTML <input type=”month”> element.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>
        HTML Input Type Month
    </title>
</head>

<body style="text-align:center;">

    <h2>HTML &lt;input type="month"&gt;</h2>

    <form id="#">
        <label for="month">Enter Month:</label>
        <input type="month" id="month" name="month">
    </form>
</body>

</html>

Output

Supported Browsers

The browsers supported by <input type=”month”> are listed below:

  • Chrome 20
  • Edge 12
  • Opera 11
  • Firefox Not Supported
  • Safari Not Supported