Notice:
The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.

step

Jump to: navigation, search

step

This article is Not Ready.

W3C Recommendation

Summary

Specify the increment for input with types number, time, or range


Applies to HTMLInputElement

When input type="range", input type="date", or input type="number" is specified, the default increment from min to max is 1. Override this default with a value in step.

Examples

A slider with a range from 1-12 that increments by 3.

HTML

<input type="range" min="1" max="24" step="3" />

A form input for a number between 0 and 15 that increments by 3.

HTML

<input type="number" min="0" max="15" step="3" />​​​​​​​​​​​​​​​​​​​​

View live example

Restricting time input to half-hours.

HTML

<input type="time"  step="1800" />

View live example

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


See also

Related articles

HTML


















  • step












































External resources

Related pages (MSDN)

Attribution

This article contains content originally from external sources.

Portions of this content come from the Mozilla Developer Network cc-by-sa-small-wpd.svg: Article

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]

This content was originally published on DevOpera, Opera's Developer Network. .