I have a content editable area and I'm trying to disable enter/return and shift enter from creating a new paragraph, I have this working with the script below but it disables the buttons all together, what I wish to do is have return just place a line break rather then go to a new paragraph.
$("#content").keypress(function(e) {
return e.which != 13;
});
All help appreciated!
Cheers,
Wazza
Try something like this:
See this answer on how to place the caret after the inserted node, plus on how to add a node : Set caret position right after the inserted element in a contentEditable div