English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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 ‹/›
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.
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.
The step attribute is an HTML5 of the new attribute.
<input step="number">
Value | Description |
---|---|
number | Specifies the legal numeric intervals for the input field. |