在 CKEDITOR 如何找到当前光标位置的下一个项目?

In CKEDITOR How to find next item to current cursor positon?

CKEDITOR如何找到当前光标位置的下一个项目

  var b=EditorInstance.document.getSelection();
  var ranges = b.getRanges();
  //console.log(ranges[0]);
   console.log(ranges[0].getNextNode().$.nodeName);

它将返回光标位置后的下一个节点名称。 如果您的光标 startoffset 是 100,那么 getNextNode 函数会提供您 101 个位置项。