I'm trying to use jQuery to intercept control-A keypresses on my web page, like so:
$(document).keypress(function (event) {
if (event.ctrlKey && (event.which == 65 || event.which == 97)) {
event.preventDefault();
// ...
}
});
This works on Firefox, but on IE7, my event handler doesn't get called, and all of the text on the page gets selected instead (as happens on Firefox without the event handler).
Is there any way I can intercept control-A's on IE?