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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <input> step-Attribut

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.

 HTML <input> Tag

Online-Beispiel

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 ‹/›

Browser-Kompatibilität

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 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.

HTML 4.01 with HTML5differences

The step attribute is an HTML5 of the new attributes added.

Syntax

<input step="number">

Attribute Value

ValueDescription
numberDefine the valid numeric intervals for the input field.
 HTML <input> Tag