由于某种原因,我需要执行:
tinyMCE.activeEditor.setContent(text, {format : 'html'});
之后,如何将光标置于文本的末尾?
ed.selection.select(ed.getBody(), true); // ed is the editor instance
ed.selection.collapse(false);
Peter Wooster似乎在线程jQuery在文本区域中设置光标位置时回答了这个问题
编辑TINYMCE使用:
tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.getBody(), true);
tinyMCE.activeEditor.selection.collapse(false);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句