How to set html content in TinyMCE?

Stevan
Stevan
62 Points
26 Posts

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

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

Share:   fb twitter linkedin
Answers
Brian
Brian
Moderator
636 Points
88 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
260 Points
75 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