HTML <input> max Attribute
Example
<form action="action.php">
<label for="date">Enter a date between (2020-01-01 - 2021-01-01):</label>
<input type="date" id="date" name="date" min="2020-01-01" max="2021-01-01"><br><br>
<label for="quantity">Quantity (between 1 and 10):</label>
<input type="number" id="quantity" name="quantity" min="0" max="10"><br><br>
<input type="submit">
</form>
Meaning
The max attribute should be set to a numeric value that is the high range allowed in the form control.
The min attribute sets the low range.
The max attributes valid for <input> type number, range, date, datetime-local, month, time and week.
Standard Syntax
HTML: <input max="number|date">
XHTML: <input max="number|date"/>
Browser Support
Status
Attribute Values
Value | Description |
---|---|
number | Specifies the maximum value allowed. |
date | Specifies the maximum date allowed. |