Toggling TinyMCE v4

Heres a easy way to turn on and off the TinyMCE editor for version 4. document.getElementById('toggle-tinymce').addEventListener('click', function(e) { e.preventDefault(); var editorID = this.dataset.editorId; var editor = tinymce.EditorManager.get(editorID); if (editor) { editor.remove(); } else { editor = tinymce.EditorManager.createEditor(editorID, tinyMCE.settings); editor.render(); } }); You…