When you click on an item, the tinymce editor is added to the textarea. When I click on another element, I want tinymce to be killed and no trace of it remains on the page, but I can’t figure out how.
tinyMCE.get('content').remove();
Such a construction (above) roughly kills the editor, but looking at the error console, I notice that autosave works, which does not find the necessary elements on the page and causes an error. Also, when the editor is “reapplied” to textarea (id = content), the editor appears, but the text field is empty, and when you click on the HTML button, a modal window opens in which there is the necessary html code located in <textarea id = "content"> </ textarea>