add

public function add(Element:String/Element/Array, n:String/Element, a:Object, h:String, c:Boolean):Element/Array
Adds the specified element to another element or elements.

Examples

// Adds a new paragraph to the end of the active editor
tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'p', {title : 'my title'}, 'Some content');

Params

Name Type Description
Element String/Element/Array id string, DOM node element or array of id's or elements to add to.
n String/Element Name of new element to add or existing element to add.
a Object Optional object collection with arguments to add to the new element(s).
h String Optional inner HTML contents to add for each element.
c Boolean Optional internal state to indicate if it should create or add.

Returns

Element/Array Element that got created or array with elements if multiple elements where passed.