How to get the content of a Tinymce textarea with JavaScript

pooja picture pooja · Dec 29, 2010 · Viewed 77.8k times · Source

i have an array of content then how we get content of Tinymce textarea in javascript

Answer

jqpress picture jqpress · Jan 18, 2012

I solved it with code:

// Get the HTML contents of the currently active editor
tinyMCE.activeEditor.getContent();

// Get the raw contents of the currently active editor
tinyMCE.activeEditor.getContent({format : 'raw'});

// Get content of a specific editor:
tinyMCE.get('content id').getContent()

the activeEditor is current editor,but i use tinyMCE.get('editor1').getContent() can not get the value of my editor, hope it can help you

Tinymce API: http://www.tinymce.com/wiki.php/API3:method.tinymce.Editor.getContent