The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
max attribute | max property
Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.
This property is read/write.
![]() ![]() |
Syntax
| HTML |
|---|
<element max="sMax" ... > |
| JavaScript |
|---|
object.max = sMax sMax = object.max |
Property values
Type: DOMString
A string containing the maximum numeric value the field accepts.
Standards information
Remarks
The following example shows the use of the min, max, and step attributes.
Note For more code samples, see Form controls part 1 and Form controls part 2: validation on the Windows Internet Explorer sample site.
Examples
<form> <label> Enter an even number between 0 and 100: <input title="Enter an even number" type="number" min="0" max="100" step="2"> <input type="submit"> </label>
See also
Show:

