Here is a jsfiddle example. I have created a div and marked is as editable. I’m trying to capture and prevent the Enter key from inserting a new line. It looks like returning false from the event’s function and stopping propagation of the event doesn’t prevent the new line <div><br></div> (in chrome other browsers insert other stuff… trying to prevent it all…) from being inserted.
Here is a jsfiddle example. I have created a div and marked is as
Share
Add
e.preventDefault();instead ofreturn false;http://jsfiddle.net/7yYpe/4/