簡體   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