Clear the TINYMCE editor's content using jquery.

Last updated 4 years, 4 months ago | 4381 views 75     5

JQuery | TinyMCE | Clear TINYMCE editor 

There is a method called setContent() in TINTMCE which you can use to reset/clear the TINTMCE editor.

<script>

// if one editor existing in your page.

tinyMCE.activeEditor.setContent('');

</script>

you can achieve the same by getting the TinyMCE instance using id and set the content to ''. The id of the first editor instance of the page is to be found in TinyMCE.editors[0].id

<script>

//It is useful if you have number of editor in your page.

var editor_id = 'my_tinymce_id'; 
tinymce.get(editor_id).setContent('');


</script>