HTML Attributes
HTML step attribute
Defines allowed value increments for applicable number and date/time inputs. The step base and default depend on the type and min or value. any disables step mismatch validation. Applicable elements include: <input>. Check each element’s value rules. For numeric and date/time controls, a step constraint is evaluated relative to a step base, generally min if valid, then the value content attribute if valid, otherwise a type-specific default. The keyword any disables the step mismatch constraint. Step units differ by input type.
Formal Syntax & Structure
html syntaxhtml
step="0.5"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| step | positive number or any | Defines allowed value increments for applicable number and date/time inputs. The step base and default depend on the type and min or value. any disables step mismatch validation. |
Working Example
Example Snippethtml
<label> Weight <input type="number" min="0" step="0.5" value="2.5"></label>Browser Compatibility
Minimum supported versions across modern rendering engines
Blink (modern)
Chrome
5
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
16
Yes
WebKit
Safari
5
Yes
Presto / Blink
Opera
≤12.1
Yes
Desktop support for step on input only; other elements, input types, individual values and mobile behavior may differ.
HTML Living Standard