Check out example codes for "CKEDITOR PUSH TEXT IN FRONT OF CURSOR". It will help you in understanding the concepts better.

Code Example 1

$.fn.insertAtCaret = function (myValue) {
    myValue = myValue.trim();
    CKEDITOR.instances['idofeditor'].insertText(myValue);
};

Learn ReactJs, React Native from akashmittal.com