setContent

public function setContent(content:String, args:Object):void
Sets the current selection to the specified content. If any contents is selected it will be replaced with the contents passed in to this function. If there is no selection the contents will be inserted where the caret is placed in the editor/page.

Examples

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

Params

Name Type Description
content String HTML contents to set could also be other formats depending on settings.
args Object Optional settings object with for example data format.