input el-input 只能输入正整数验证

2023-02-17,,,,

字母e在js中属于数字,所以一般的正则匹配 \d 是拦不住字母e 的

正确写法为:

onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"


input el-input 只能输入正整数验证的相关教程结束。

《input el-input 只能输入正整数验证.doc》

下载本文的Word格式文档,以方便收藏与打印。