28 Votes

TinyMCE: Remove TinyMCE Editor from Textarea

Question by Guest | Last update on 2023-12-19 | Created on 2014-05-06

It was no problem for me to integrate the TinyMCE HTML editor in my existing website using tinymce.init(). However, I have no idea of how to remove an existing editor again.

Is there any possibility to remove TinyMCE from a textarea by JavaScript?

ReplyPositiveNegative
4Best Answer14 Votes

From TinyMCE version 4 on, this is possible by just calling tinymce.remove().

If you would like to remove all editors, you can just call tinymce.remove() without any parameters:

tinymce.remove();

If you only would like to remove the editors, that are bind to textareas or divs, you can use one of the following commands:

tinymce.remove('textarea');
tinymce.remove('div');

And if you would like to remove only a special instance of TinyMCE, you can also pass the appropriate ID:

tinymce.remove('#id');

Of course, you can also use other selectors such as classes, for example.

Older versions of TinyMCE can be removed using the line tinyMCE.execCommand('mceRemoveControl', false, 'myid'), where you have to adjust "myid" to what you want to remove.
Last update on 2023-12-19 | Created on 2014-05-06

ReplyPositive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.