HTML <input> min属性
例
最小属性と最大属性の使用:
<form action="/action_page.php">
<label for="datemax">Enter a date before 1980-01-01:</label>
<input type="date" id="datemax" name="datemax" max="1979-12-31"><br><br>
<label for="datemin">Enter a date after 2000-01-01:</label>
<input type="date" id="datemin" name="datemin" min="2000-01-02"><br><br>
<label for="quantity">Quantity (between 1 and 5):</label>
<input type="number" id="quantity" name="quantity" min="1" max="5"><br><br>
<input type="submit">
</form>
定義と使用法
このmin
属性は、要素の最小値を指定します
<input>
。
ヒント:min
属性を属性と一緒に
使用してmax
、有効な値の範囲を作成します。
注:max
and属性はmin
、数値、範囲、日付、日時-ローカル、月、時刻、および週の入力タイプで機能します。
ブラウザのサポート
表の数字は、属性を完全にサポートする最初のブラウザーバージョンを示しています。
Attribute | |||||
---|---|---|---|---|---|
min | 5.0 | 10.0 | 16.0 | 5.1 | 10.6 |
構文
<input min="number|date">
属性値
Value | Description |
---|---|
number | Specifies the minimum value allowed |
date | Specifies the minimum date allowed |
❮HTML<input>タグ