How does the value in input type= "number" limit the size of numbers

for example:

<input type="numer" value="10"/>

I hope that the value should not exceed 5, so how to control it. The
document gives the max attribute, but it is of no use ~

May.22,2021

the size limit of max,min and the step attribute are used by the up and down buttons on the right. If you enter the value manually, it is an input box

you can listen to input's input event or change event to implement


< input type= "number" max= "10" step= "3" >
how can it not work?


add oninput events such as > 5000:
oninput = "if (value > 5000) value=5000;"

Menu