HTML step Attribute

❮ HTML Attributes

Example

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

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

<element step="number">



Browser Support




Status




Applies to:

The step attribute can be used on the following element:

Element Attribute
<input> step






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.
❮ HTML Attributes