The min attribute on an <input> tag sets the minimum value for that element.
The input element must be of a type that accept numeric, date, or time values.
A min attribute on a number <input> element.
A minimum value that can be entered in this number input is set.
<form action="/tutorial/action.html">
Quantity
<input type="number" name="number" min="1" max="10" value="3">
<br /> <br />
<input type="submit">
</form>
The min attribute specifies the minimum value allowed in the input element.
This attribute only applies to these input types:
With numbers, the min value must be less than the max value. For dates this is not required.
<input min="number | datetime">
Value | Description |
---|---|
number | Minimum numeric value. |
datetime | Minimum datetime value. |
Here is when min support started for each browser:
Chrome
|
5.0 | May 2010 |
Firefox
|
16.0 | Oct 2012 |
IE/Edge
|
10.0 | Sep 2012 |
Opera
|
10.6 | Jul 2010 |
Safari
|
5.1 | Oct 2011 |
Back to <input>