function moveEnd(obj){
        obj.focus();
        var len = obj.value.length;
        if (document.selection) {//ie识别
            var sel = obj.createTextRange();
            sel.moveStart('character',len);
            sel.collapse();
            sel.select();
        } else if (typeof obj.selectionStart == 'number' && typeof obj.selectionEnd == 'number') {
            obj.selectionStart = obj.selectionEnd = len;//ff和chrome
        }


    }


仅仅用调用方法。传进去对象就可以,jquery演示样例:moveEnd($(".moreComment  textarea")[0]);

相关文章:

  • 2022-02-14
  • 2021-11-13
  • 2021-09-11
  • 2022-12-23
  • 2022-02-11
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-31
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案