Javascript and TinyMCE (cannot change .law or textarea value with TinyMCE)

In an ideal world (without TinyMCE), the following code works fine: document.myform.textarea.value += '[MY_BB_CODE]';

If TinyMCE is enabled on this page, I cannot use standard javascript. I googled around and did not find any JAVASCRIPT-ONLY solutions for which the TinyMCE plugin was not required ... I'm sure that I am not looking in the right places, but has anyone here encountered this problem?

+4
source share
2 answers
 tinyMCE.execCommand('mceReplaceContent',false,TextToAdd); 
+3
source

You can also do

 tinyMCE.get('tinymce_id').setContent(my_new_content); 
+6
source

All Articles