how to get div selectionstart and selectionend for firefox and ghroom?
<p>when Im using this code inside text area its working perfect bu i need it for my div the selectionstart and selectionend functions gives undefined values why can any one help me with this here are my code</p>

<pre><code>{var textarea = document.getElementById("content_text");

if ($.browser.webkit || $.browser.mozilla) {
        var start = textarea.selectionStart;
        var end = textarea.selectionEnd;
        sel = textarea.value.substring(start, end); 
    }
</code></pre>
