How to use month input type in HTML?

HTMLWeb DevelopmentFront End Technology

The month input type is used in HTML using the <input type="month">. Using this, allow the users to select month and year. A date picker popup is visible whenever you will give a user input to the month input type.

Note − The input type month is not supported on Firefox and Internet Explorer. It works on Google Chrome.

Example

You can try to run the following code to learn how to use month input type in HTML. It will show both month and year.

<!DOCTYPE html>
<html>
   <head>
      <title>HTML input month</title>
   </head>
   <body>
      <form action = "" method = "get">
         Details:<br><br>
         Student Name<br><input type="name" name="sname"><br>
         Month and Year of Birth<br><input type="month" name="bmonth"><br>
         <input type="submit" value="Submit">
      </form>
   </body>
</html>
raja
Published on 23-Jan-2018 15:01:01
Advertisements