English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die input step-Attribut legt den Abstand zwischen den gültigen Nummern im <input>-Element fest, wenn step = " 3,-3,0,3,6und, gleichzeitig kann das step-Attribut mit den Attributen max und min kombiniert werden, um ein gültiges Wertebereich zu erstellen.
Ein HTML-Formular, bei dem die Eingabefelder eine spezifische gültige Nummernintervalle haben:
<!DOCTYPE html> <html> <head> <title>HTML: <input> step-Attribut - Grundlagen-Tutorial-Website(oldtoolbag.com)</title> <body> <form action="action_page.php"> <input type="number" name="points" step="3"> <input type="submit"> </form> </html>Testen Sie, sehen Sie ‹/›
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 valid numbers in the <input> element.
3,-3,0,3,6and so on.
Tip:The step attribute can be used with max and min properties to use together to create a range of valid 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 attributes added.
<input step="number">
Value | Description |
---|---|
number | Define the valid numeric intervals for the input field. |