HTML max attribute

max attribute gives the maximum value in input field. It means value cannot exceed the maximum value in the input element.

Example

 <p>Volume (cubic centimeter): <input type="number" min="0" max="100" step="1"></p>
 <p>Diameter (cm):<input type="number" min="0" max="4" step="0.09"></p>
Try </>

max attribute value

The value is valid floating point number.

Related Tags

The tags which support this attribute are as follows.

<input> tag

input element represents input control in a form. If the value that is greater than max value the form will not be submitted .

Example


<input type="number" min="0" max="10">
Try</>

<meter> tag

meter tag represents the completion of a task in the form of a bar for known range value. For instance, the completion of charging of a battery.

Example


<meter value="250" min="10" max="1000"> </meter>
Try</>

<progress> tag

progress element represents the completion of a task in the form of progress bar.

Example


<progress value="310" max="1000"> </progress>
Try</>

We restrict the range of the bar by the max attribute.



Was this article helpful?

 

Email:

Message:

Get the newsletter