Babiker Babiker - 6 months ago 46
Javascript Question

How can i blur a div where contentEditable=true?

How can i blur/focusout a div where contentEditable=true? I have attempted

$(elm).blur()
and
$(elm).attr('contentEditable', false);

Answer

$("div[contentEditable]").blur() to blur all contentEditable elements.

$("#elementId").blur() to blur an element by its id.