Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The HTMLInputElement.stepDown() method decrements the value of a numeric type of <input> element by the value of the step attribute or up to n multiples of the step attribute if a number is passed as the parameter.
The method, when invoked, decrements the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified.
Valid on all numeric, date, and time input types that support the step attribute, including date, month, week, time, datetime-local, number, and range.
Given <input id="myTime" type="time" max="17:00" step="900" value="17:00">, invoking myTime.stepDown(3) will change the value to 16:15, decrementing the time by 3 * 900, or 45 minutes. myTime.stepDown(), with no parameter, would have resulted in 16:45, as n defaults to 1.
However, calling stepDown on <input type="time" max="17:00" step="900"> would not set the value to 17:00, as one would expect — and as it does for stepUp when the input is <input type="time" min="17:00" step="900">. Instead, the first call to stepDown will set the initial value to 23:45 even though the max attribute is set. The second call will set the value to 17:00. And the third call to will set the value to 16:45.
The method, when invoked, changes the form control's value by the value given in the step attribute, multiplied by the parameter, within the constraints set within the form control. The default value for the parameter, if not is passed, is 1. The method will not cause the value to go below the min value set or defy the constraints set by the step attribute. A negative value for n will increment the value, but will not increment beyond the max value.
If the value before invoking the stepDown() method is invalid, for example, if it doesn't match the constraints set by the step attribute, invoking the stepDown() method will return a value that does match the form controls constraints.
If the form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the list of supported input types above), or if the step value is set to any, an InvalidStateError exception is thrown.
A numeric value. If no parameter is passed, stepDecrement defaults to 1.
If the value is a float, the value will decrement as if Math.floor(stepDecrement) was passed. If the value is negative, the value will be incremented instead of decremented.
None (undefined).
Thrown in one of the following cases:
Click the button in this example to decrement the number input type:
Note if you don't pass a parameter to the stepDown() method, it defaults to 1. Any other value is a multiplier of the step attribute value, which in this case is 5. If we pass 4 as the stepDecrement, the input will stepDown by 4 * 5, or 20. If the parameter is 0, the number will not be decremented. The stepDown() method will not allow the input to go out of range, in this case stopping when it reaches 0 and rounding down and floats that are passed as a parameter.
Try setting the step decrement input to 1.2. What happens when you invoke the method?
Try setting the value to 44, which is not valid. What happens when you invoke the method?
| HTML # dom-input-stepdown-dev |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jun 23, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.