how to clear ckeditor with jquery

前端 未结 4 407
伪装坚强ぢ
伪装坚强ぢ 2021-01-04 01:50

How can i clear the ckeditor textarea with jquery at the click of a button/link?

I have tried this : $(\"textarea.editor\").val(\'\'); and $(\"tex

4条回答
  •  孤城傲影
    2021-01-04 02:15

    In my code i had to change the text in the ckeditor programmatically but it did not work until i did a defered set. This may be helpful.

    _.defer(function () {
        it._controls.wysiwyg.setData(bodyText); // by the direct reference
        //CKEDITOR.instances.editor1.setData(''); // or this way like in the example
    }); 
    

提交回复
热议问题