How to use week input type in HTML?


The week input type is used in HTML using the <input type="week">. Using this, allow users to select a week and year.

A date picker popup is visible whenever you will give a user input to the week input type.

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

weel Input

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

Example

Live Demo
<!DOCTYPE html>
<html>
   <head>
      <title>HTML input week</title>
   </head>

   <body>
      <form action = "" method = "get">
         Details:<br><br>
         Student Name<br><input type = "name" name = "sname"><br>
         Training week<br><input type = "week" name = "week"><br>
         <input type = "submit" value = "Submit">
      </form>
   </body>
   
</html>

Sai Subramanyam
Sai Subramanyam

Passionate, Curious and Enthusiastic.

Updated on: 30-Jul-2019

316 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements