Advertisement
Home Open Editor ❯

HTML <input> step Attribute

Example

<form action="action.php">
  <label for="qty">quantity:</label>
  <input type="number" id="qty" name="qty" step="2">
  <input type="submit">
</form>

Try this code ❯

Meaning

The step attribute defines the step in which values can take.

The step defaults to 1 for number and range.

In date/time input types, step is expressed in seconds, with the default step being 60 seconds. The step scale factor is 1000 (which converts the seconds to milliseconds, as used in other algorithms).

Example:


Standard Syntax

HTML: <input step="number">

XHTML: <input step="number"/>


Advertisement

Attribute Values

Value Description
number Defines the interval between legal numbers in the input field. Default is 1.

The value must be a positive number, integer or float or the special value any, which means no stepping is implied, and any value is allowed.
Home Open Editor ❯
Advertisement