Input Date step attribute
Definition and usage
step
Set or return the value of the step attribute of the date field.
The HTML step attribute specifies the legal date intervals that the user can select when opening the date field.
For example, if step = "2", then you can only select every other day in the calendar.
See also:
HTML Reference Manual:HTML <input> step Attribute
Example
Example 1
Change the legal number of days between dates:
document.getElementById("myDate").step = "2";
Example 2
Get a valid date interval:
var x = document.getElementById("myDate").step;
Syntax
Return the step attribute:
inputdateObject.step
Set the step attribute:
inputdateObject.step = number
Attribute value
Value | Description |
---|---|
number |
Specify the legal number of days between dates. The default is 1 day. For example:
|
Technical Details
Return Value: | Numeric value, representing the valid number of days. |
---|
Browser Support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |
Note:The <input type="date"> element does not display any date field/calendar in IE11 and earlier versions.