jquery remove text selection range after pasteHTML
<p>I have a JavaScript snippet:</p>

<pre><code>// IE &lt; 9
r = document.selection.createRange();
r.collapse(true);
r.pasteHTML("&lt;p&gt; test html &lt;/p&gt;");
</code></pre>

<p>This works but what I want is that once the HTML is pasted, it must lose the selection.</p>

<p>In other words, what happens is that after <code>pasteHtml</code> method executes, the text "test html" is selected on the page. I don't want this. I want text to be unselected but the cursor should be positioned at end of "test html" text.
I'm doing this in:</p>

<pre><code>&lt;div contenteditable="true"&gt; &lt;/div&gt;
</code></pre>

<p>How can I do this?</p>
