X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <input> step Attribute

HTML input Tag Reference HTML <input> tag

Example

An HTML form with an input field with a specified legal number intervals:

<form action="demo_form.asp">
<input type="number" name="points" step="3">
<input type="submit">
</form>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The step attribute is supported in all major browsers.

Note: The step attribute of the <input> tag is not supported in Internet Explorer 9 and earlier versions.


Definition and Usage

The step attribute specifies the legal number intervals for an <input> element.

Example: if step="3", legal numbers could be -3, 0, 3, 6, etc.

Tip: The step attribute can be used together with the max and min attributes to create a range of legal values.

Note: The step attribute works with the following input types: number, range, date, datetime, datetime-local, month, time and week.


Differences Between HTML 4.01 and HTML5

The step attribute is new in HTML5.


Syntax

<input step="number">

Attribute Values

Value Description
number Specifies the legal number intervals for the input field. Default is 1


HTML input Tag Reference HTML <input> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook