JS 监听键盘按键
1. 实现Ctrl+ Enter 组合键触发事件
document.onkeydown=function(event){
var keyNum = window.event ? event.keyCode :event.which;
if( event.ctrlKey && keyNum == 13){
console.log("你按下了Ctrl + Enter")
}
};
document.onkeydown=function(event){
var keyNum = window.event ? event.keyCode :event.which;
if( event.ctrlKey && keyNum == 13){
console.log("你按下了Ctrl + Enter")
}
};