Immediately make a reservation: this topic was raised here, but the answer is not given.
I make a block with data entry from a plastic card. There are 4 input, they must be input only numbers and no more than 4.
<div class="card__input-num"> <input class="input card__input-num_item" type="number" min="1" max="4" autocomplete="off"> <input class="input card__input-num_item" type="number" autocomplete="off" maxlength="4" min="4" max="4"> <input class="input card__input-num_item" type="number autocomplete="off" maxlength="4"> <input class="input card__input-num_item" type="number" autocomplete="off" maxlength="4"> </div>
-In the first input, only digits and only 4 are entered (by the way, the English letter "e" for some reason can also be entered).
-In the second the same. It is understandable.
- In the third one I accidentally took one double quote after type = "number - and about a miracle! You can enter no more than 4 digits! But now the letters are also available for input, it is clear why, but it is not clear why maxlength =" 4 "has earned!?
does min / max make it work too? Or am I doing something wrong?
maxlengthfornumberdoes not work. Usetextand validate for correct input. - Enikeyschik