How can I disable Ctrl+A (select all) using jquery in a browser?

this code works for every combination of ctrl+key you want
65 is the ascii code of ‘A’

add 97 if you want to check also for ‘a’

$(function(){   
    $(document).keydown(function(objEvent) {        
        if (objEvent.ctrlKey) {          
            if (objEvent.keyCode == 65) {                         
                objEvent.disableTextSelect();
                return false;
            }            
        }        
    });
});    

Should works, I wrote it directly without testing..

Leave a Comment