input el-input 只能输入正整数验证
时间:2019-05-31 20:30:47
收藏:0
阅读:2777
字母e在js中属于数字,所以一般的正则匹配 \d 是拦不住字母e 的
正确写法为:
onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"

原文:https://www.cnblogs.com/fmixue/p/10957038.html
评论(0)