all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

step property

Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.

This property is read/write.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.10.7.3.11Internet Explorer 10

 

Syntax

JavaScript
object.step = ptr
ptr = object.step

 

Property values

Type: DOMString

A string containing a numeric value.

Standards information

Remarks

Anything outside that range or an odd number will not be submitted, and an error message will be displayed.

The following example shows the use of the min, max, and step attributes.


<form>
<label>
Enter an even number between 0 and 100: <input title="Enter an even number" type="number" min="0" max="100" step="2"> <input type="submit">
</label>


See also

HTMLInputElement
input type=range

 

 

Show:
© 2014 Microsoft