The max attribute specifies the maximum value for an <input> element.
Applies to [HTMLInputElement](/html/elements/input)The max attribute works with the following input types: [number](/html/elements/input/type/number), [range](/html/elements/input/type/range), [date](/html/elements/input/type/date), [datetime](/w/index.php?title=html/elements/input/type/datetime&action=edit&redlink=1), [datetime-local](/html/elements/input/type/datetime-local), [month](/html/elements/input/type/month), [time](/html/elements/input/type/time) and [week](/html/elements/input/type/week).
For datetime, datetime-local, month, time, and week the value of the attribute must be a valid string of the type.
For number and range the value of the attribute must be a number: decimal or integer.
ExamplesTwo examples of max attributes on inputs.
The following date control limits input to dates that are before the 1980s:
<input name="start" type="date" max="1979-12-31">
<br>
Must be a number at least 1 and less than 101:
<input name="quantity" required type="number" max="100" min="1">
See also Related articles HTML
max (HTMLInputElement)
Microsoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4