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