Input Date stepDown() Method
Definition and Usage
stepDown()
The method decreases the value of the date field by the specified number.
This method only affects the day (and not the month and year).
Tip:To increase the value, please use stepUp() Method.
Example
Example 1
Subtract 5 days from the value of the date field:
document.getElementById("myDate").stepDown(5);
Example 2
Subtract 1 day (default):
document.getElementById("myDate").stepDown();
Grammar
inputdateObject.stepDown()number)
Parameter Value
Parameter | Description |
---|---|
number |
Required. Specifies the number of days to be reduced in the date field. If omitted, the number of days is reduced by "1". |
Technical Details
Return Value:
No Return Value.
Browser Support
The numbers in the table indicate the first browser version that fully supports this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 12.0 | 17.0 | Support | Support |