So I have this code which set the cursor to the end of div contenteditable:
div contenteditable
function setCursorAtTheEnd(el) { var range = document.createRange();