W3Schools.com

HTML5 <input> step Attribute

HTML5 input Tag Reference HTML5 <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 currently only supported in Opera and Chrome.


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


HTML5 input Tag Reference HTML5 <input> tag
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE