I have an input field number that you can see on snippet below, this seems to work but there is a bug.
When you insert 89, it works and returns the max value as it is supposed to.
But if the first digit is under 7, it doesn't work (any number under 69). It only compares the first digit and not the final digit.
How can I use it the right way?
Thank you!
<input type="number" name="teste" id="teste"
value="0" min="0" max="7"
onchange="javascript: if (this.value > this.max) this.value = this.max;" />