一、阻止ctrl+s的默认行为
document.onkeydown = function(e){
e = window.event || e;
var keycode = e.keyCode || e.which;
if(e.ctrlKey && keycode == 83 ){
if(window.event){// ie
try{
e.keyCode = 0;
}catch(e){}
e.returnValue = false;
console.log(1)
}else{// ff
e.preventDefault();
console.log(1)
}
}
}
原文地址:https://www.cnblogs.com/rain101/p/10100432.html
时间: 2024-10-30 22:30:49