gpt4 book ai didi

ckeditor - 如何使用Jquery按类选择CKEditor内的元素

转载 作者:行者123 更新时间:2023-12-04 22:33:38 25 4
gpt4 key购买 nike

我无法找到如何使用 jQuery 选择器按类在 CKEditor 中选择元素,因此感谢您提供任何帮助。

最佳答案

CKEDITOR.instances.editor1.window.getFrame().$为编辑器可编辑区域检索 native DOM 元素。所以:

$( CKEDITOR.instances.editor1.window.getFrame().$ ).contents().find( anything );

应该可以解决你的问题。

另请注意,CKEditor 提供了用于 DOM 操作的 API:
CKEDITOR.instances.editor1.document.getById( 'someId' );
CKEDITOR.instances.editor1.document.getElementsByTag( 'div' );

关于ckeditor - 如何使用Jquery按类选择CKEditor内的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14192054/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com