<textarea id="info" ></textarea> var obj = document.getElementById("info"); obj.scrollTop = obj.scrollHeight;
将焦点定位到文本最末尾
setSelectionRange(document.getElementById("info"), len, len); //将光标定位到文本最后
<textarea id="info" ></textarea> var obj = document.getElementById("info"); obj.scrollTop = obj.scrollHeight;
将焦点定位到文本最末尾
setSelectionRange(document.getElementById("info"), len, len); //将光标定位到文本最后