<input type="text" maxlength="5" /> 效果ok,当 <input type="number" maxlength="5" />时maxlength失效,长度可以无限输入。
解放方案:
<input type="number" oninput="if(value.length>5)value=value.slice(0,5)" />
原文:https://blog.csdn.net/malan_wpf/article/details/50788275
上一篇CSS---伪类选择器
下一篇cookie js案例
苹果iphone如何开启青少年模式
微信青少年模式怎么关闭
Web CSS
网页播放摄像头视频 一种新的实现方式(非ocx方式)
学习js和jQuery总结
Web HTML
Flask简单http接口实现
PHP文件基础操作