出于某种原因,我需要执行:
tinyMCE.activeEditor.setContent(text, {format : 'html'});
之后,如何将光标定位到文本末尾?
最佳答案
ed.selection.select(ed.getBody(), true); // ed is the editor instance
ed.selection.collapse(false);
这似乎由 Peter Wooster 在线程 jQuery Set Cursor Position in Text Area 中回答
编辑 TINYMCE 使用:
tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.getBody(), true);
tinyMCE.activeEditor.selection.collapse(false);
关于javascript - tinymce 4 如何将光标放在文本末尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19829126/