step
Summary
Specify the increment for input with types number, time, or range
Applies to | [HTMLInputElement](/html/elements/input) |
---|
Examples
A slider with a range from 1-12 that increments by 3.
<input type="range" min="1" max="24" step="3" />
A form input for a number between 0 and 15 that increments by 3.
<input type="number" min="0" max="15" step="3" />
Restricting time input to half-hours.
<input type="time" step="1800" />
Usage
* when used for input type="time", value must be in seconds
Notes
Remarks
The following example shows the use of the min, max, and step attributes.
Syntax
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.10.7.3.11
See also
Related articles
HTML
step
External resources
- http://dev.opera.com/articles/view/new-form-features-in-html5/#input-datetime
- http://www.quirksmode.org/html5/inputs.html
Related pages
- HTMLInputElementHTMLInputElement
- input type=numberinput type=number
- input type=rangeinput type=range
Attributions
Mozilla Developer Network : Article
Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This content was originally published on DevOpera, Opera's Developer Network. .