Search code examples
jquerytinymce

TinyMCE 4 - remove() or destroy()


I am using TinyMCE editor. I want to remove or destroy tinymce editors (Page contain more then one editor). Also remove classes and IDs added by tinyMCE.

But leave editable contents

I tried :

tinymce.remove()
tinymce.destroy()
tinymce.execCommand('mceRemoveControl',true,'.editable');

Please note:

my editor class is .editable, And I have more then one editors in my page.


Solution

  • You need an editor id (which usually equals your editor html root elements id (in most cases a textarea)).

    Example:

    tinymce.execCommand('mceRemoveControl', true, 'my_original_textarea_id');