The min
attribute on an element specifies the minimum value that can be entered.
Elements that accept this attribute include <input> and <meter>.
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="2">
<br /> <br />
<input type="submit">
</form>
For additional details see our HTML input min Reference.
The min
attribute specifies the minimum value allowed in an element.
On an <input> element, the min
attribute only applies to these input types:
<tagname min="number | datetime">
Value | Description |
---|---|
number | Minimum numeric value. |
datetime | Minimum datetime value. |
The following elements accept the min
attribute.
Elements | Description | |
---|---|---|
<input> | Specifies an input field -- see example above | |
<meter> | Creates a scalar measurement control with a known range. |
A <meter> tag with a min attribute.
The meter value cannot be lower than 1.
<div>Pressure reading</div>
<br />
<meter min="1" max="25" value="14">14/25</meter>
For additional details see our HTML meter min Reference.
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 |