Capturing ctrl+z key combination in javascript
Use onkeydown (or onkeyup), not onkeypress Use keyCode 90, not 122 function KeyPress(e) { var evtobj = window.event? event : e if (evtobj.keyCode == 90 && evtobj.ctrlKey) alert(“Ctrl+z”); } document.onkeydown = KeyPress; Online demo: http://jsfiddle.net/29sVC/ To clarify, keycodes are not the same as character codes. Character codes are for text (they differ depending on the … Read more