繁体   English   中英

通过父元素获取CKEDITOR.instance

[英]Get CKEDITOR.instance by parent element

我有一些带有随机实例 ID 的 CKEDITOR.instances。 编辑器通过第 3 方 API 交付。我将编辑器实例包装在如下列表中:

<ul>
<li id="mykeyA">
<!-- here is the editor instance 1 with random ID-->
</li>
<li id="mykeyB">
<!-- here is the editor instance 2 with random ID-->
</li>
<li id="mykeyC">
<!-- here is the editor instance 3 with random ID-->
</li>
</ul>

我需要通过我的 ID 访问 CKEDITOR.instance。 类似于:将CKEDITOR.instance放置在 ID为 mykeyB的 LI 元素中。

我试过这个: $('#mykeyB').children[CKEDITOR.instance] 但这不起作用。

如何通过包装元素获取实例?

如果别人找的话。 这对我有用

var editor_instance = $('#mykeyB').find('textarea')[0].name;
console.log(CKEDITOR.instances[editor_instance]);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM