Reputation: 47
The maxlength attribute is not working with
<input type="number" maxlength="5" maxlength="10" />
Upvotes: 4
Views: 10801
Reputation: 1763
HTML input type number does not have maxlength
and minlength
attribute, instead it has min
and max
attribute, you can use min
and max
to length of input.
For eg. for maxlength 2 and minlength 0, you can use min
and max
like this-
<input type="number" min="0" max="99" />
Upvotes: 7