tinymce formatChanged() example

Example 1: tinymce extract value

// 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()

Example 2: tinymce.value

// Add a class to all paragraphs in the editor.
tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');

// Gets the current editors selection as text
tinymce.activeEditor.selection.getContent({format: 'text'});

// Creates a new editor instance
var ed = new tinymce.Editor('textareaid', {
    some_setting: 1
}, tinymce.EditorManager);

ed.render();

Tags:

Misc Example