Cursor position, jquery
<p>From <a href="http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area">this post</a> I found and answer on how to position the cursor in a textarea. </p>

<p>I am creating a jquery chat and I wanted to create a simple html textarea, having a div infront of the textarea displying the html contained in the textarea. </p>

<p>Mark posted the following script:</p>

<pre><code>$.fn.selectRange = function(start, end) {

        return this.each(function() {
                if(this.setSelectionRange) {
                        this.focus();
                        this.setSelectionRange(start, end);
                } else if(this.createTextRange) {
                        var range = this.createTextRange();
                        range.collapse(true);
                        range.moveEnd('character', end);
                        range.moveStart('character', start);
                        range.select();
                }
        });
};
</code></pre>

<p>Witch works fine, but my problem is, how do I find the end position in the div of the html displayed there?</p>
