Clear the TINYMCE editor's content using jquery.

88 Views

Clear the TINYMCE editor's content using jquery.

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>

 

Tags:-
JQuery