Input Range step Attribute
Definition and Usage
step
The attribute sets or returns the value of the slider control's step attribute.
The HTML step attribute specifies the size of the slider control's movement each time (the increment or jump between values).
The HTML step attribute is used to limit the number of allowed values.
Tip:The step attribute can be used with max and min Attributes can be used together to create a series of valid values.
See also:
HTML Reference Manual:HTML <input> step Attribute
Instance
Example 1
Change the value of the step attribute:
document.getElementById("myRange").step = "25";
Example 2
Display the step attribute value of the slider control:
var x = document.getElementById("myRange").step;
Syntax
Return the step attribute:
rangeObject.step
Set the step attribute:
rangeObject.step = number
attribute value
value | description |
---|---|
number |
Specifies the amount of movement (increment or jump between values) of the slider control each time. Default is "1". |
Technical Details
Return Value: | A number representing the increment between values. |
---|
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 |