如何将光标设置到textarea当前行的末尾?

时间:2021-03-13 21:10:37

标签: javascript textarea

我找到了 How to set cursor at the end in a textarea? 但这只是将光标设置到整个文本的末尾。

但是,我想将光标设置到活动行的末尾。

HTML 文本区域:

This is my textarea,
we assume the cursor is before the | here
                                   ^
Now it should jump to the end, behind "here".

如何使用 Javascript 实现这一点?

0 个答案:

没有答案