Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select element inside CKEditor by class using Jquery

Tags:

ckeditor

I cannot find out how to select element inside CKEditor by class using jQuery selector, so any help is appreciated.

like image 838
user271507 Avatar asked Jan 07 '13 08:01

user271507


1 Answers

CKEDITOR.instances.editor1.window.getFrame().$ retrieves a native DOM element for editor editable area. So:

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

Should solve your problem.


Also note that CKEditor provides an API for DOM manipulation:

CKEDITOR.instances.editor1.document.getById( 'someId' );
CKEDITOR.instances.editor1.document.getElementsByTag( 'div' );
like image 98
oleq Avatar answered Sep 28 '22 07:09

oleq