Input Date step Property
Example
Change the legal day intervals:
document.getElementById("myDate").step = "2";
Try it Yourself »
Description
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.
Browser Support
Property | |||||
---|---|---|---|---|---|
step | Yes | 12.0 | Yes | Yes | Yes |
Note: <input type="date"> does not show as a proper date field in IE11, and earlier.
Syntax
Return the step property:
inputdateObject.step
Set the step property:
inputdateObject.step = number
Property Values
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. |
Technical Details
Return Value: | A Number, representing the legal day intervals |
---|
More Examples
Example
Get the legal day intervals:
var x = document.getElementById("myDate").step;
Try it Yourself »
Related Pages
HTML reference: HTML <input> step attribute
❮ Input Date Object
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.