In this: http://jsfiddle.net/bLHVh/4/ I have a contenteditable div, and whenever you enter it, it replaces 'a' with 'b' as a simple example (of course, it will be useful later ) It works fine until you hit enter, then the div loses focus after every keystroke. Why is this?
try it
$("#area").bind('keypress', function(e){ if(e.which == 13){ e.preventDefault(); } });