so, I have:
<div contentEditable ="true" ...
and selected text inside that.
<img src = '...' onclick = "document.execCommand('underline')" />
Clicking there works, the text inside div stays selected and becomes underlined;
I have span, onclick it produces js generated color picker. And at that moment (clicking) text get deselected. Way around that ?
Edit: If I replace span with img, selected text is not deselected ! But unfortunately it gets deselected, selecting color in color picker. ...