CKEditor library registers a global variable (object) CKEDITOR
(refers to window.CKEDITOR
):
console.log( CKEDITOR );
> Object {...}
When you create an instance, let's say with CKEDITOR.replace()
, it's registered in CKEDITOR.instances
object. The key in this object corresponds to the name of the instance.
console.log( CKEDITOR.instances.editor1 );
> Object {...}
This is the way you access the API of your editor, until you destroy it. So if you want to retrieve data from your editor, basically call:
console.log( CKEDITOR.instances.editor1.getData() );
> "<p>Some text</p>"
If you want to use jQuery to play with CKEditor, there's an official wrapper (adapter) for CKEditor API.
Also, considering the fact that you want to use CKEditor to produce HTML for some tooltip, you may want to avoid creating paragraphs by the editor (default behavior). You can do that by setting the configuration option: config.enterMode
to CKEDITOR.ENTER_BR
. See the article about configuring CKEditor.