$('selector').keypress(function(e) { console.log(e.shiftKey); if ((.altKey) { e.preventDefault(); alert('Disallowed'); } });
alt
$(".txt").keypress(function(e) { if(e.altKey){ return false; // or e.preventDefault(); } });
<script language="javascript" type="text/javascript"> function getKeyCodeEvent(ev) { var code = (document.all) ? event.keyCode:ev.which; var alt = (document.all) ? event.altKey:ev.modifiers & Event.ALT_MASK; if (document.all) { if (alt && code==115) //Example ALT+F4 { try{ //your requirements }catch(e){ } } } } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)