HTML step Attribute

❮ HTML Attributes


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


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).


Standard Syntax

<element step="number">

Browser Support


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