input type=number maxlength无效
生活随笔
收集整理的這篇文章主要介紹了
input type=number maxlength无效
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
問題:input標簽type=number時maxlength屬性無效
解釋:通過在MDN上搜索得知maxlength屬性是控制value的最大長度(最多字符數目),maxlength屬性對于type=password, search, tel, text, url,這五種生效,附上鏈接
解決方案:
- 其實現在很多的ui框架都會做單獨的數字輸入框,如iview的<InputNumber/>
- 還有oninput事件 當長度超過截取
總結
以上是生活随笔為你收集整理的input type=number maxlength无效的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用vue+textarea的属性max
- 下一篇: Noise-contrastive es