TinyMCE:API/tinymce.dom.Selection/setContent

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Method: setContent

Summary

Replaces the current selection with the specified content. If there is no selection the content will be inserted at the caret position.

Syntax

<void> setContent(<String> h, <Object> s)

Parameters

h
HTML content to set; could also be other formats depending on settings.
s
Optional settings object with for example data format.

Examples

// Inserts some HTML contents at the current selection
tinyMCE.activeEditor.selection.setContent('<strong>Some contents</strong>');
Personal tools