节点 JAVASCRIPT代码:
Editor= CKEDITOR.instances['ckeditor1'];
getElem=Editor.document.getSelection().getStartElement();
getElem.setHtml("<Element6>SomeText</Element6>");
工作: FireFox
无法正常工作: Internet Explorer
错误是:`'Editor.document.getSelection()为空或不是对象
如何获取IE中光标位置的父节点?
数据发送者:
<Element1>SomeText<Element2>SomeText</Element2>
<Element3>Some**[suppose Cursor Is Here]** Text </Element3>
</Element1>
必填结果:
<Element1>SomeText<Element2>SomeText</Element2><Element3>
<Element6>SomeText</Element6>
</Element3></Element1>
答案 0 :(得分:0)
以下代码运作良好.. 感谢* Reinmar *
Editor= CKEDITOR.instances['ckeditor1'];
Editor.focus();
getElem=Editor.document.getSelection().getStartElement();
getElem.setHtml("<Element6>SomeText</Element6>");