I need to move caret to end of contenteditable
node like on Gmail notes widget.
I read threads on StackOverflow, but those solutions are based on using
If you don't care about older browsers, this one did the trick for me.
// [optional] make sure focus is on the element
yourContentEditableElement.focus();
// select all the content in the element
document.execCommand('selectAll', false, null);
// collapse selection to the end
document.getSelection().collapseToEnd();