English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <input> step attribute

The input step attribute specifies the interval between valid numbers in the <input> element, if step = " 3“”-3,0,3,6Also, the step attribute can be used with the max and min attributes to create a range of valid values.

 HTML <input> tag

Online Example

An HTML form with input fields that have specified valid numeric intervals:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <input> step attribute - Basic Tutorial Website(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  <input type="number" name="points" step="3">
  <input type="submit">
</form>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 10, Opera, Chrome, and Safari support the step attribute.

Note:Firefox or Internet Explorer 9 and earlier versions do not support the step attribute of the <input> tag.

Definition and Usage

The step attribute specifies the interval between legal numbers in the <input> element.

3“”-3,0,3,6and so on.

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

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

HTML 4.01 with HTML5difference

The step attribute is an HTML5 of the new attribute.

Syntax

<input step="number">

Attribute Value

ValueDescription
numberSpecifies the legal numeric intervals for the input field.
 HTML <input> tag