I am trying to get IE to paste to the current caret position in a contenteditable div. IE will paste fine if you have some text selected but if you have nothing selected it pastes your text to the top of the page. Is there a way to have it paste to the caret position instead of the top of the page?
<div id='ce' contenteditable='true'>select me...</div>
document.getElementById("insert").onclick = function() {
document.selection.createRange().pasteHTML("-PASTED HTML-");
};