Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

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.

Example

#

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">
  <fieldset>
    <legend>Select Week/Year</legend>

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

    <input type="submit" value="Submit">
  </fieldset>
</form>

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.


Syntax

<input type="week">

Browser support

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

Chrome
25.0 Feb 2013
Firefox
Not Supported
IE/Edge
12.0 Jul 2015
Opera
10.1 Jun 2009
Safari
Not Supported

You may also like

 Back to <input>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides