- Attribute of
- How To Use Input To Create Form Fields In HTML: Easy Tutorial
- What does
- Specifies a minimum value for number and date input fields.
<form> <label for="hours">How many hours are you available to work each week?</label><br> <input type="number" id="hours" name="hours" min="15"> </form> <!-- Try putting in 10 and pressing enter. -->
min attribute and data validation
min attribute works on
<input> elements of the
min attribute, like all other HTML-based data validation, should be thought of as helpful to the user, more than helpful to you as a developer. Because of the way forms work, it is still possible for malicious users (or users with old browsers, even) to provide data outside the range specified by the
max attributes. So you will still need to handle data validation (and sanitization) on the server.
Browser Support for min