I have this jsFiddle: http://jsfiddle.net/RGmNz/6/
And have tried to disable CTRL + B and CTRL + U etc…
$("iframe").contents().find("body").keydown(function(a,b){
if(a.which ==32 && a.ctrlKey){
a.preventDefault();
}
});
})
But it still bolds the text!
It works if you make two changes: (1) Use the right keycode for b, i.e., 66 rather than 32, and (2) add a call to
.stopPropagation():Demo: http://jsfiddle.net/RGmNz/7/
Or you can
return falsewhich is the equivalent of both.preventDefault()and.stopPropagation().