我找到了 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 实现这一点?