When pressing enter in contenteditable in chrome, a div is inserted. This interferes with my markup, I need it to be a br.
I know that shift-enter is a br. What is the best way to solve the problem?
Thanks.
Reformulating the question: How do I trigger shift-enter when someone presses enter?
I've tried writing something like this:
$(document).keyup(function hotkeys(e) {
if (e.which == 13)
{
e = jQuery.Event("keydown")
e.which = 16;
$(document).trigger(e);
e.which = 13;
$(document).trigger(e);
alert("trigger");
}
});
It doesn't work.
Thanks.