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', then valid numbers can be -3, 0, 3, 6, etc., and 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 e Safari supportano l'attributo step.
Attenzione:Firefox o Internet Explorer 9 e versioni precedenti non supportano l'attributo step dell'etichetta <input>.
L'attributo step specifica l'intervallo tra i numeri validi dell'elemento <input>.
Ad esempio: se step =“ 3”, i numeri validi possono essere -3, 0, 3, 6 e così via.
Suggerimento:L'attributo step può essere utilizzato con max e min Attributi combinati per creare un intervallo di valori validi.
Attenzione:L'attributo step è applicabile ai seguenti tipi di input: number, range, date, datetime, datetime-local, month, time e week.
L'attributo step è una nuova attributo in HTML5.
<input step="number">
Valore | Descrizione |
---|---|
number | Definire l'intervento numerico legittimo del campo di input. |