max (HTMLInputElement)

Jump to: navigation, search

max (HTMLInputElement)

This article is Not Ready.


W3C Candidate Recommendation

Summary

The max attribute specifies the maximum value for an <input> element.


Applies to HTMLInputElement

The max attribute works with the following input types: number, range, date, datetime, datetime-local, month, time and 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.

Examples

View live exampleTwo examples of max attributes on inputs.

HTML

The following date control limits input to dates that are before the 1980s:
<input name="start" type="date" max="1979-12-31">

Must be a number at least 1 and less than 101: <input name="quantity" required type="number" max="100" min="1">



Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support Supported (when?)
?
10
?
?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic Support ?
?
?
?
10
?
?
?

See also

Related articles

HTML
















  • html/attributes/max (HTMLInputElement)



































… further results

Other articles

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]