English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The min attribute specifies the minimum value of the <input> element, and when used with the max attribute, it can create a valid value range.
Usage of min and max attributes:
<!DOCTYPE html> <html> <head> <title>HTML: <input> max and min attributes - Basic Tutorial Website(oldtoolbag.com)</title> <body> <form action="action_page.php"> input1999year11month31date before the day: <input type="date" name="bday" max="1999-11-31><br> input2010year1month2date after the day: <input type="date" name="bday" min="2010-01-02><br> quantity(1to5between): <input type="number" name="quantity" min="1" max="5><br> <input type="submit"> </form> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 10Opera, Chrome, and Safari support the min attribute.
Note:Firefox or Internet Explorer 9 and earlier versions do not support the min attribute of the <input> tag.
Note:Due to Internet Explorer 10 The min attribute is not applicable to these input types, min attribute will not work on IE 10 of date and time.
The min attribute specifies the minimum value for the <input> element.
Tip:The min attribute is used with max attributes in combination can create a valid range of values.
Note:The max and min attributes are applicable to the following input types: number, range, date, datetime, datetime-local.-local, month, time, and week.
The min attribute is an HTML5 introduces the new attribute.
<input min="number|date">
Value | Description |
---|---|
number | Numeric value. Specifies the minimum value allowed for the input field. |
date | Date. Specifies the minimum value allowed for the input field. |