HTML min attribute

min attribute specifies the minimum value in the input field or meter element.


 <p>Temperature (celcius): <input type="number" min="0" max="10"></p>
 <p>Radius (cm):<input type="number" min="0" max="2" ></p>
Try </>

If the user enters the value less than the minimum value, then the form is not submitted and it forces the user to select minimum value.

min attribute values

The value of this attribute is a floating point number.

Related Tags

The tags which support this attribute are as follows.

<input> tag

Input element allows the user to enter data in the form. This element is used in the form element. It supports the min attribute.

See the example given above to understand.

<meter> tag

It represents the completion of a task in the form of a bar for known range value. For instance, the progress of a battery being charged.


<meter min=0 max=150 value=70 title="kilogram">70</meter>


It indicates that the value can not be negative. value attribute represents the current value of the meter.

Was this article helpful?




Get the newsletter