How can I blur/focusout a div where contentEditable=true? I have attempted $(elm).blur() and $(elm).attr(\'contentEditable\', false);
$(elm).blur()
$(elm).attr(\'contentEditable\', false);
The suggested solution by Roman Resh doesn't work when you click into the element and hit enter immediately after. It won't blur but create line-breaks/divs.
It is possible to prevent this behaviour entirely.
See this fiddle
$('') .appendTo('body').focus().remove();