因为number只能输入数字,但是e和E在数学中都为科学计数法,所以可以输入,但可用正则过滤掉。
<input type="number" onkeypress="return /\d/.test(String.fromCharCode(event.keycode))">
版权属于:小小窝/禾下月
本文链接:https://hxyxyz.top/index.php/Web/205.html
本站文章采用 知识共享署名4.0 国际许可协议 进行许可,请在转载时注明出处及本声明!
因为number只能输入数字,但是e和E在数学中都为科学计数法,所以可以输入,但可用正则过滤掉。
<input type="number" onkeypress="return /\d/.test(String.fromCharCode(event.keycode))">
版权属于:小小窝/禾下月
本文链接:https://hxyxyz.top/index.php/Web/205.html
本站文章采用 知识共享署名4.0 国际许可协议 进行许可,请在转载时注明出处及本声明!