I have the following code demonstrating contenteditable property and a button that will inject bold text into the paragraph with contenteditable area. My question is how to retu
YOU SHOULD USE .contents()
var current; $(function(){ $("p[contenteditable]").focus(function() { current = this; }); $('#bold').click(function (){ document.execCommand('bold', false, true); $(current).contents().focus(); }); });