HTMLInputElement: step property - Web APIs | MDN
Value
A string representing the element's step value or an empty string if no step is explicitly set.
Example
js
const inputElement = document.querySelector('[type="number"]');
console.log(inputElement.step); // the current value of the step attribute
inputElement.step = 0.1; // sets the step value to "0.1"
inputElement.step = "any"; // sets the step to "any"
Specifications
| Specification |
|---|
| HTML # dom-input-step |
Browser compatibility
See also
<input>of type range, number, date, month, week, and timeHTMLInputElement.valueHTMLInputElement.type