HTML DOM Input Week step Property

Input Week Object : Change the legal week intervals

Definition and Usage

The step property sets or returns the value of the step attribute of a week field.

The step attribute specifies the legal week intervals to choose from when the user opens the calendar in a week field.

For example, if step = "2", you can only select every second week in the calendar.

Browser Support

Property
step Yes 10.0 Yes Yes Yes
Note: The <input type="week"> element does not show any date field/calendar in Firefox.

Syntax

Return the step property:

weekObject.step

Set the step property:

weekObject.step = number

Property Values

Value Description
number Specifies the legal week intervals. Default is 1 week.

Examples:

If step="2", you can only select every second week in the week calendar.

If step="10", you can only select every tenth week in the week calendar.

Technical Details

Return Value: A Number, representing the legal week intervals

More Examples

Example

Get the legal week intervals:

var x = document.getElementById("myWeek").step;

Related Pages

HTML reference: HTML <input> step attribute

❮ Input Week Object