设置输入框之只能输入正整数,同时,其长度最大只有3位

设置输入框之只能输入正整数,同时,其长度最大只有3位

<input type="text" maxlength="3" placeholder="请输入数量,最大 999" onkeyup="value=value.replace(/^(0+)|[^d]+/g,'')">
原文地址:https://www.cnblogs.com/GetcharZp/p/11942196.html