How can I disable Ctrl+A (select all) using jquery in a browser?
- by Keltex
I'm trying to prevent information to be copied from a page (for non-technical users of course). I know how to disable selecting text using the mouse. The following jquery code works:
$(function(){
$.extend($.fn.disableTextSelect = function() {
return this.each(function(){
if($.browser.mozilla){//Firefox
$(this).css('MozUserSelect','none');
}else if($.browser.msie){//IE
$(this).bind('selectstart',function(){return false;});
}else{//Opera, etc.
$(this).mousedown(function(){return false;});
});
});
$('.noSelect').disableTextSelect();
});
But users can still use Ctrl+A to select the entire page. Any workarounds for this?