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 used together to create a series of valid values.
See also:
HTML Reference Manual:Attribut step de <input> HTML
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 |
Définit la quantité de déplacement de la glissière (l'augmentation entre les valeurs ou le saut) de l'élément de contrôle de glissière. Par défaut, "1". |
Détails techniques
Valeur de retour : | Nombre, représentant l'augmentation entre les valeurs. |
---|
Support du navigateur
Les numéros dans le tableau indiquent la version du navigateur qui prend en charge cette propriété pour la première fois.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |