My script won't work in IE (even 9)? simple javascript to amend copy text
<p>So I was browsing the internet one day, and copied a chunk of text "<strong>my cool text</strong>" and pasted it to facebook, only to see that it changed it to "<strong>my cool text - Read More at <em>URL</em></strong>", I was in awe! That's awesome!</p>

<p>So I dove in a little and found some tutorials and such. I took to my own to convert it to a customizable plugin with dozens of options, and it outputs this (or similar based on options):</p>

<pre><code>function copyCopyright() {
    var theBody = document.getElementsByTagName("body")[0];
    var selection;
    selection = window.getSelection();
    var copyrightLink = '&lt;br /&gt;&lt;br /&gt;Read more at: '+document.location.href+'&lt;br /&gt; &amp;copy;2012  ';
    var copytext = selection + copyrightLink;
    var extraDiv = document.createElement("div");
    extraDiv.style.position="absolute";
    extraDiv.style.left="-99999px";
    theBody.appendChild(extraDiv);
    extraDiv.innerHTML = copytext;
    selection.selectAllChildren(extraDiv);
    window.setTimeout(function() {
        theBody.removeChild(extraDiv);
    },0);
}
document.oncopy = copyCopyright;​
</code></pre>

<p>works GREAT in Chrome and Firefox, etc. But of COURSE it doesn't work in IE (even IE9!). I'm fairly new to Javascript, especially hunting down IE problems with it.</p>

<p>Is there a function or method or something above that IE just won't recognize that I'll have to find an alternate way around?</p>
