The min and max Attributes

The min and max Attributes

<pre><code>Enter a date before 1980-01-01:
&lt;input type=&quot;date&quot; name=&quot;bday&quot; max=&quot;1979-12-31&quot;&gt;

Enter a date after 2000-01-01:
&lt;input type=&quot;date&quot; name=&quot;bday&quot; min=&quot;2000-01-02&quot;&gt;

Quantity (between 1 and 5):
&lt;input type=&quot;number&quot; name=&quot;quantity&quot; min=&quot;1&quot; max=&quot;5&quot;&gt;</code></pre>

Specify the minimum and maximum values for an <input> element.

Work with the following input types: number, range, date, datetime-local, month, time and week.

Related concepts

The min and max Attributes — Structure map

Clickable & Draggable!

The min and max Attributes — Related pages: