HTML Attributes

HTML max attribute

Build a form with the HTML form generator

Sets the upper constraint for applicable input types or the upper bound for meter and progress. Format and defaults depend on the element and input type. Applicable elements include: <input>, <meter>, <progress>. Check each element’s value rules.

Formal Syntax & Structure

html syntaxhtml
max="8"

Parameters & Attributes

NameTypeDescription
maxnumber or type-specific date/timeSets the upper constraint for applicable input types or the upper bound for meter and progress. Format and defaults depend on the element and input type.

Working Example

Example Snippethtml
<label>  Seats  <input type="number" min="1" max="8" value="2"></label>

Browser Compatibility

Minimum supported versions across modern rendering engines

Blink (modern)
Chrome
4
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
16
Yes
WebKit
Safari
5
Yes
Presto / Blink
Opera
≤12.1
Yes
Desktop support for max on input only; other elements, input types, individual values and mobile behavior may differ.
HTML Living Standard
HTML Reference