xgMz's answer was best for me. You don't need to worry about the browser:
var html = $("#MyTextArea").val();
$("#MyTextArea").focus().val("").val(html);
And here's a quick jQuery extension I wrote to do this for me next time:
; (function($) {
$.fn.focusToEnd = function() {
return this.each(function() {
var v = $(this).val();
$(this).focus().val("").val(v);
});
};
})(jQuery);
Use like this:
$("#MyTextArea").focusToEnd();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…