Javascript屏蔽IE和Firefox浏览器默认按键响应(快捷键功能)

function stopDefault( e ) {
   // Prevent the default browser action (W3C)
   if ( e && e.preventDefault )
      e.preventDefault();
   else
   // A shortcut for stoping the browser action in IE
      window.event.returnValue = false;
   return false;
}
需要在按键事件中调用上面的函数,即可进行屏蔽,例:
if(e.code!=8)
       keyValue = kc.get(e.code);
else
       backspace(e);
原文地址:https://www.cnblogs.com/top5/p/2415984.html