How can I tell the owner of a selection?
<p>How can I tell who the parent node of a selection is?</p>

<p>I'm getting a selection with:</p>

<pre><code>        var userSelection;
        if (window.getSelection) {
            userSelection = window.getSelection();
        }
        else if (document.selection) { 
            userSelection = document.selection.createRange();
        }

        var selectedText = userSelection;
        if (userSelection.text)
            selectedText = userSelection.text;
</code></pre>

<p>But how can i tell who's the parent node of the selection? That is, if the whole selection is from withing a single <code>div</code> I want to know that div.</p>
