只能输入数字的正则表达式在火狐的兼容问题解决方法

<input alt="" class="" name='' type="text" onkeypress="return (/[d.]/.test(String.fromCharCode(event.which||event.KeyCode)))"/>

加入了event.which  保证了火狐的兼容问题

原文地址:https://www.cnblogs.com/enmeen/p/5357938.html