火狐不支持event.keyCode,用jquery中的event.which轻松解决。
生活随笔
收集整理的这篇文章主要介绍了
火狐不支持event.keyCode,用jquery中的event.which轻松解决。
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
2019独角兽企业重金招聘Python工程师标准>>>
$(':text[name="price"]').keypress(function(e) {if (e.which == 46|| ((e.which >= 48 && e.which <= 57)|| e.which == 8||e.which==0)) {return true;} else {alert("只可以输入数字哦!");$('#go').attr('disabled','disabled');return false;}});//0代表选择了esc转载于:https://my.oschina.net/kkrgwbj/blog/212228
总结
以上是生活随笔为你收集整理的火狐不支持event.keyCode,用jquery中的event.which轻松解决。的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: php文件上传参数设置
- 下一篇: Winsock编程原理——面向连接