To retrieve content from the editor, either process the content with a form handler or use the getContent API.
If you use a form handler, once the <form> is submitted, {productname} {productmajorversion} will POST the content in the same way as a normal HTML <textarea>, including the HTML elements and inline CSS of the editor content. The host’s form handler can process the submitted content in the same way as content from a regular <textarea>.
Use the getContent and setContent APIs to read and write editor content from JavaScript.
const editor = tinymce.activeEditor;
const html = editor.getContent();
console.log(html);To retrieve the content as plain text instead of HTML:
const editor = tinymce.activeEditor;
const text = editor.getContent({ format: 'text' });
console.log(text);