Javascript "getSelection" only if it's in a certain div
<p>So I'm trying to collect what people are selecting on our site. Currently, it works EVERYWHERE, and I don't want that. I only want it if they are selecting in a certain DIV.</p>

<p>it's basically a simple modification to a script I found.</p>

<pre><code>&lt;script type="text/javascript"&gt;
function appendCopyright() {
    var theBody = document.getElementsByClassName("sbReview")[0];
    var selection;
    selection = window.getSelection();
    var copyrightLink = '&lt;br /&gt;&lt;br /&gt; - Read more at: &lt;a href="'+document.location.href+'"&gt;'+document.location.href+'&lt;/a&gt;&lt;br /&gt;&amp;copy;2012 &lt;? printf($product. ' &amp; ' .$spOrganization); ?&gt;';
    var copytext = selection + copyrightLink;
    var extra = document.createElement("div");
    extra.style.position="absolute";
    extra.style.left="-99999px";
    theBody.appendChild(extra);
    extra.innerHTML = copytext;
    selection.selectAllChildren(extra);
    window.setTimeout(function() {
    theBody.removeChild(extra);
    },0);
}
document.oncopy = appendCopyright;
</code></pre>

<p></p>

<p>I tried modifying <code>selection = window.getSelection();</code> but it just broke it :(</p>

<p>Basically, I want the above code, ONLY to work in a certain div, not the whole <code>body</code></p>
