trying to get focus to end of textarea after creating a dynamic value with jquery
<p>Here is my javascript:</p>

<pre><code>$(document).ready(function(){
    $(".reply").click(function(){
        var replyId = $(this).attr("id");
        $("textarea[name='comment']").val("&lt;reply:"+replyId+"&gt;");
        $("textarea[name='comment']").ready(function(){
            moveCursorToEnd($(this));
        });
    });
});

function moveCursorToEnd(el) {
    if (typeof el.selectionStart == "number") {
        el.selectionStart = el.selectionEnd = el.value.length;
    } else if (typeof el.createTextRange != "undefined") {
        el.focus();
        var range = el.createTextRange();
        range.collapse(false);
        range.select();
    }
}
</code></pre>

<p>I am somewhat new to functions with javascript however this does not seem to work It will put the value in but not focus to the textarea. I am sure I am doing something very dumb, any ideas?</p>
