How to disable the entire tinyMCE text area?

I have a form with about 10 small tinyMCE editors, when I click the Disable button, I want these fields to be read-only? Is this possible if you do not have an id. Can I do this using any method, maybe JavaScript, jQuery?

I tried these methods but not working

tinyMCE.init( {mode: "none",readonly : true });
$('input, select, textarea').attr('disabled', 'disabled');
+3
source share
2 answers

This will cycle through all instances of the editor and close them.

for (var i = tinymce.editors.length - 1; i >= 0; i--) {
  tinyMCE.execCommand("mceRemoveControl", true, tinymce.editors[i].id);
}
+5
source

Source: https://habr.com/ru/post/1779959/


All Articles