解决:input框当type为number时maxlength失效

慕客网标明的用法是适用type为text和passswod的
在这里插入图片描述
当我input框设置type为number的时候怎么限制输入长度呢?使用outinput就可以啦

<input type="number" name="phone" id="phone" value="phone" oninput="if(value.length>11)value=value.slice(0,11)" />

猜你喜欢

转载自blog.csdn.net/Ariel_201311/article/details/87857456