Change the legal day intervals:
The step property sets or returns the value of the step attribute of a date field.
The step attribute specifies the legal day intervals to choose from when the user opens the calendar in a date field.
For example, if step = "2", you can only select every second day in the calendar.
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="date"> element is not supported in Internet Explorer or Firefox.
Return the step property:
Set the step property:
Value | Description |
---|---|
number |
Specifies the legal day intervals. Default is 1 day. Examples: If step="2", you can only select every second day in the date calendar. If step="10", you can only select every tenth day in the date calendar. |
Return Value: | A Number, representing the legal day intervals |
---|
Get the legal day intervals:
The result of x will be:
HTML reference: HTML <input> step attribute