Minimum and maximum limit of a number in an input of type number

5

Hello, I would like to know how I can put a limit, a minimum and maximum number that can be typed in the field. For example, make the number entered in the field below can not be less than 0 and greater than 9.

Note: Only integers from 0 to 9.

<input type="number" id="nota" name="nota" class="form-control">
    
asked by anonymous 15.12.2015 / 17:52

1 answer

4

You can use the attributes min and max if you are using HTML5

<input type="number" min="1" max="10">
    
15.12.2015 / 17:55