Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input min attribute

HTML min property

HTML input Tag Reference HTML tag

Example

Using the min and max attributes:

Enter a date before 1980-01-01:


Enter a date after 2000-01-01:


Quantity (between 1 and 5):


Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Opera, Chrome, and Safari support the min attribute.

**Note:** Firefox or Internet Explorer 9 and earlier versions do not support the the min attribute of the tag.

**Note:** Since Internet Explorer 10 does not support these input types, the min attribute will not work with date and time in IE 10.


Definition and Usage

The min attribute specifies the minimum value of the element.

**Tip:** The min attribute is used together with the max attribute to create a range of legal values.

**Note:** The max and min attributes apply to the following input types: number, range, date, datetime, datetime-local, month, time, and week.


Differences between HTML 4.01 and HTML5

The min attribute is new in HTML5.


Syntax

Attribute values

Value Description
number A number. Specifies the minimum value allowed in the input field.
date A date. Specifies the minimum value allowed in the input field.

HTML input Tag Reference HTML tag