
Derek S. answered 04/24/19
Full time Web Developer, Part time Game Designer
Instead of "maxlength", try just "max".
for example, <input type="number" max="12"> will make it so that users can't insert a number greater than 12.
This also works with "min", too, so if you wanted to restrict users to a number between 1 and 10, you could do
<input type="number" min="1" max="10">
Just keep in mind that it won't restrict users from manually typing a number outside of that range, but if you wrap your inputs inside a <form> element, the browser will prompt them to give a proper answer inside your specified range before submitting.