<input type="text" maxlength="11" /> 长度虽然限制了,但键盘调出来的是英文键盘,
当 <input type="number" maxlength="11" /> 时maxlength失效,长度可以无限输入。
解放方案:
<input type="number" oninput="if(value.length>11)value=value.slice(0,11)" />
转载于:https://my.oschina.net/hehongbo/blog/840556