TinyMCE:API/tinymce.dom.Selection/getContent

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Method: getContent

Summary

Returns the selected contents using the DOM serializer passed in to this class.

Syntax

<String> getContent(<Object> s)

Parameters

s
Optional settings class with for example output format text or html.

Returns

Selected contents in for example HTML format.

Examples

// Alerts the currently selected contents
alert(tinyMCE.activeEditor.selection.getContent());

// Alerts the currently selected contents as plain text
alert(tinyMCE.activeEditor.selection.getContent({format : 'text'}));
Personal tools