HTML <input> type="week"

The <input> tag with a type="week" attribute creates an input field that accepts a week and year value.

Inside this field is a calendar icon. Clicking this icon opens a week/year picker.



An <input> element of type week.
Clicking the calendar icon opens a week/year picker. Alternatively, enter a value directly into the field.

Select Week/Year

<form action="/tutorial/action.html">
    <legend>Select Week/Year</legend>

    <input type="week" name="week"><br /><br />

    <input type="submit" value="Submit">

Using input type="week"

The <input type="week"> creates an input field that accepts week and year data.

Clicking the calendar icon inside the field will open a week/year picker.

The control's UI varies from browser to browser. Browser support is spotty.

The week field also accepts manual entry which follows a week and year format.


<input type="week">

Browser support

Here is when type="week" support started for each browser:

25.0 Feb 2013
Not Supported
12.0 Jul 2015
10.1 Jun 2009
Not Supported

You may also like

 Back to <input>

Author: Jack Poorte
Published: Jun 20 2021
Last Reviewed: Sep 30 2023

What's your favorite/least favorite part of Dofactory?