How do I set a value in CKEditor with Javascript? How do I set a value in CKEditor with Javascript? javascript javascript

How do I set a value in CKEditor with Javascript?


Use the CKEditor method setData():

CKEDITOR.instances[**fieldname**].setData(**your data**)


The insertHtml() and insertText() methods will insert data into the editor window, adding to whatever is there already.

However, to replace the entire editor content, use setData().