JS获取键盘上任意按键的值(实例代码)
人气:0
废话不多说,直接上代码
function keyUp(){
if(navigator.appName == "Microsoft Internet Explorer"){
var keycode = event.keyCode;
}else{
varkeycode = keyUp.caller.arguments[0].which;
}
alert(keycode);
}
复制代码 代码如下:
function keyUp(){
if(navigator.appName == "Microsoft Internet Explorer"){
var keycode = event.keyCode;
}else{
varkeycode = keyUp.caller.arguments[0].which;
}
alert(keycode);
}
加载全部内容