I have some textareas and all of them are with tinyMCE.
I would like to set the content of the specific textarea, but I can\'t find how.
I have tryed this:>
In TinyMCE 5, you can do this using the setContent()
method.
Let’s say you have initialized the editor on a textarea with id=”myTextarea”
. First access the editor using that same id, then call setContent()
. For example:
tinymce.get('#myTextarea').setContent('Hello world!
');
Or, instead of accessing the editor by id, you can access the active editor:
tinymce.activeEditor.setContent('Hello world!
');
More info and examples here: https://www.tiny.cloud/blog/how-to-get-content-and-set-content-in-tinymce.