可能重复:
CKEditor - 将光标位置设置为文本结尾
我有<div>很多内容.单击此div后,将加载CKEditor以编辑此div.
现在我想在用编辑器替换它之后将插入符/光标设置到内容的末尾.
我的代码目前是这样的:
var editor = CKEDITOR.replace('content', {
// Settings
// Event listeners
on: {
instanceReady: function(evt) {
var editor = evt.editor;
// give focus (displays caret at the beginning of the content, not the end)
editor.focus();
}
}
});
Run Code Online (Sandbox Code Playgroud)