javascript监听按键
document.addEventListener('keydown',test);
function test(e){
var x=e.keyCode;
if(x == 49){
console.log("hello");
}
}
document.addEventListener('keydown',test);
function test(e){
var x=e.keyCode;
if(x == 49){
console.log("hello");
}
}