实现代码如下:

document.onkeypress = function( e ){
alert( getCharCode( e ) );
};
function getCharCode( e ){
var e = e || window.event;
if( typeof e.charCode == "number" ){
return e.charCode;
}else{
return e.keyCode;
};
};

以上就是【onkeypress字符按键兼容所有浏览器使用介绍】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)

与本文相关的软件

发表我的评论

最新评论

  1. 暂无评论