Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 java 脚本在 CKEditor 中选择当前(光标位置)元素。
当右键单击事件发生时,我必须选择我右键单击的元素。
这是您正在寻找的解决方案:
var editor = CKEDITOR.instances.editor1, sel = editor.getSelection(); sel.selectElement(sel.getStartElement());