input中type为number

如果使用了<input type="number" maxlength="11">

你会发现它并无法限制11位的长度

解决办法是<input type="number"  oninput="if(value.length>11)value=value.slice(0,11)"/>

猜你喜欢

转载自blog.csdn.net/ozhy111/article/details/87199838