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.
<form action="/tutorial/action.html"> <fieldset> <legend>Select Week/Year</legend> <input type="week" name="week"><br /><br /> <input type="submit" value="Submit"> </fieldset> </form>
<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.
Here is when
type="week" support started for each browser:
Back to <input>