HTML wejściowe max atrybuty
Przykłady
min i max atrybuty używać:
<form action="demo_form.html">
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31">
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-02">
Quantity (between 1 and 5):
<input type="number" name="quantity" min="1" max="5">
<input type="submit">
</form>
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31">
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-02">
Quantity (between 1 and 5):
<input type="number" name="quantity" min="1" max="5">
<input type="submit">
</form>
Spróbuj »
Pomoc Browser
Internet Explorer 10, Opera, Chrome i Safari max wsparcie atrybutów.
Uwaga: Firefox lub Internet Explorer 9 i wcześniejsze wersje nie obsługują max atrybut znacznika <input>.
Uwaga: Ponieważ Internet Explorer 10 nie obsługuje tego typu wejścia, max atrybutu IE 10 nie stosuje się do daty i czasu.
Definicja i Wykorzystanie
atrybut max określa maksymalną wartość <input> elementów.
Wskazówka: Własność max min nieruchomość używana w połączeniu stworzyć szereg wartości prawnych.
Uwaga: max i min atrybuty odnoszą się do następujących typów wejścia: liczba, zakres, data, datetime , datetime-local, miesiąc czasu i tygodniowym.
Różnice między HTML 4.01 i HTML5
atrybut max jest nowy w atrybutach HTML5.
gramatyka
<input max="number|date">
Wartość nieruchomości
值 | 描述 |
---|---|
number | 数字值。规定输入字段允许的最大值。 |
date | 日期。规定输入字段允许的最大值。 |
HTML <input> tag