If you are trying to add HTML text, you can use the createFromHtml method, for example:
var imgHtml = CKEDITOR.dom.element.createFromHtml("<img src=" + imageSrcUrl + " alt='' align='right'/>");
where imageSrcUrl is the location of the image, and then you can insert it into the ckeditor source as follows:
CKEDITOR.instances.body.insertElement(imgHtml);
There are other methods, such as insertHtml or insertText, you can check the CKEditor API for more details on this.
Maricel
source share