84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
一个支付页面,用户只能输入. 和数字,keypress事件和电脑端的通用吗?这串代码 在手机端可用吗?兼容安卓和苹果 ,可有原生方法?$('.fuck').keypress(function(event) {
var eventObj = event || e; var keyCode = eventObj.keyCode || eventObj.which; if ((keyCode ???)) return true; else return false; })
光阴似箭催人老,日月如移越少年。
这就是原生事件 通用的参考是否可用:http://caniuse.com/#search=ke...ASCII码对照表:http://tool.oschina.net/commo...
document.querySelector('#answerEditor').addEventListener('keypress', e => { var eve = e || event; var code = eve.keyCode; if(code != 46 && !(code >= 48 && code <=59)) { eve.returnValue = false; return false; } });
type="num"
这就是原生事件 通用的
参考是否可用:http://caniuse.com/#search=ke...
ASCII码对照表:http://tool.oschina.net/commo...
type="num"