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:Η ιδιότητα step του <input> του HTML

Example

Example 1

Change the value of the step attribute:

document.getElementById("myRange").step = "25";

Try it yourself

Example 2

Display the step attribute value of the slider control:

var x = document.getElementById("myRange").step;

Try it yourself

Syntax

Return the step attribute:

rangeObject.step

Set the step attribute:

rangeObject.step = number

attribute value

value description
number

Ορίζει τη ποσότητα της κίνησης του滑块控件 κάθε φορά (αύξηση τιμών ή άλμα) της τιμής.

Από προεπιλογή "1".

Τεχνικά λεπτομέρειες

Αποτελεσματική τιμή: Αριθμοί, που δείχνουν τη μεγεθύνη της αύξησης μεταξύ τιμών.

Υποστήριξη περιηγητών

Τα αριθμήματα στην τаблицή δείχνουν την έκδοση του προγράμματος περιήγησης που υποστηρίζει πλήρως την ιδιότητα.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Υποστήριξη 10.0 Υποστήριξη Υποστήριξη Υποστήριξη