Latest web development tutorials
 

Input Week step Property

< Input Week Object

Example

Change the legal week intervals:

document.getElementById("myWeek").step = "2";
Try it Yourself »

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

Internet Explorer Firefox Opera Google Chrome Safari

The step property is supported in all major browsers.

Note: The step property is not supported in Internet Explorer 9 and earlier versions.

Note: The <input type="week"> element is not supported in Internet Explorer or 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;

The result of x will be:

3
Try it Yourself »

Related Pages

HTML reference: HTML <input> step attribute


< Input Week Object