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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <input> max Attribut

Das Attribut max legt den maximalen Wert des <input>-Elements fest, die Attribute max und min sind für die folgenden Input-Typen gültig: number, range, date, datetime, datetime-local, month, time and week.

 HTML <input> Tag

Online-Beispiel

Demonstration der Verwendung der Attribute min und max:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <input> max und min Attribute - Grundlegende Anleitung (oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  Eingabe1999Jahr11Monat31Datum vor dem:
  <input type="date" name="bday" max="1999-11-31><br>
  Eingabe2010Jahr1Monat2Datum nach dem:
  <input type="date" name="bday" min="2010-01-02><br>
  Anzahl (1bis5zwischen):
  <input type="number" name="quantity" min="1" max="5><br>
  <input type="go submit">
</form>
</html>
Testen Sie, ob ‹/›

Browserkompatibilität

IEFirefoxOperaChromeSafari

Internet Explorer 10Opera, Chrome und Safari unterstützen das Attribut max.

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

Note:Due to Internet Explorer 10 These input types are not supported, the max attribute will not apply to IE 10 in date and time.

Definition and Usage

The max attribute specifies the maximum value of the <input> element.

Hint:The max attribute is with min attributes can be used together to create a valid value range.

Note:The max and min attributes apply to the following input types: number, range, date, datetime, datetime-local, month, time and week.

HTML 4.01 with HTML5differences

The max attribute is an HTML5 with the new attribute.

Syntax

<input max="number|date">

Attribute Value

ValueDescription
numberNumeric value. Specifies the maximum allowed value for the input field.
dateDate. Specifies the maximum allowed value for the input field.
 HTML <input> Tag