How to set html content in TinyMCE?

Stevan
Stevan
312 Points
20 Posts

I'm try to set content in tinyMCE editor as:

textAreatinyMCE.value= 'some text'
Views: 3015
Total Answered: 2
Total Marked As Answer: 2
Posted On: 05-Nov-2021 02:37

Share:   fb twitter linkedin
Answers
Brian
Brian
2376 Points
13 Posts
         

You can do this using the setContent() method from the TinyMCE API.

tinymce.get("textAreatinyMCE").setContent("<p>Hello world!</p>");
Posted On: 05-Nov-2021 07:35
thanks
 - Stevan  07-Nov-2021 03:36
beginer
beginer
1544 Points
52 Posts
         

Also, we can use active editor:

tinymce.activeEditor.setContent("<p>Hello world!</p>");
Posted On: 05-Nov-2021 07:48
thanks.
 - Stevan  07-Nov-2021 03:36
 Log In to Chat