Solve the problem that the type of the input input box is set to number, the maxlength is invalid, and the content can be input infinitely

question

The input input box type is set to number, and the maxlength is invalid

Solution:
add oninput

<input type="number" oninput="if(value.length>10)value=value.slice(0,10)" />

Guess you like

Origin blog.csdn.net/weixin_41891519/article/details/114587124
Recommended