Horje

How to add HTML <input> min Attribute on label Tag

Use of the min and max attributes.

Definition and Usage

The min attribute specifies the minimum value for an <input> element.

Tip: Use the min attribute together with the max attribute to create a range of legal values.

Note: The max and min attributes works with the following input types: number, range, date, datetime-local, month, time and week.


Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Syntax

<input min="number|date">

Attribute Values

Value Description
number Specifies the minimum value allowed
date Specifies the minimum date allowed
index.html
Example: HTML
<label for="quantity">Quantity (between 1 and 5):</label>
<input type="number" id="quantity" name="quantity" min="1" max="5">

Output should be:

How to add HTML <input> min Attribute on label Tag




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin