js文本框自动写数据时滚动条始终保持在最下方

1 //获取id为textarea的滚动条高度
2 var top = $("#textarea")[0].scrollHeight;
3 //滚动条滚动到最下方
4 $("#textarea").scrollTop(top);

 

posted @ 2020-05-11 16:18  bud  阅读(769)  评论(0)    收藏  举报