Alvin Stefanus
Alvin Stefanus

Reputation: 2153

CKEditor destroy instances does not clean up classes and other attributes

Im using CKEditor and tried to destroy the instances by these code

function DestroyAllCKEDITOR() {
    //Destroy all existing instances
    for (name in CKEDITOR.instances) {
        if (name != "template") {
            var editor = CKEDITOR.instances[name];
            if ((typeof (editor) != 'undefined') && (editor != null)) {
                editor.destroy(true);
            }
        }
    };
}

But after the instances got destroyed, i still have this line of code

<div class="item-container cke_editable_inline cke_contents_ltr" style="position: relative;" tabindex="0" spellcheck="false" role="textbox" aria-label="Rich Text Editor, editor1" title="Rich Text Editor, editor1" aria-describedby="cke_232">

I want to remove class: cke_editable_inline cke_contents_ltr aria-label, title, and describedby.

Upvotes: 2

Views: 342

Answers (1)

Gacci
Gacci

Reputation: 1398

Try adding editor = undefined after editor.destroy(true). I had the same problem and it worked for me!

Upvotes: 1

Related Questions