TinyMCE:API/tinymce.dom.DOMUtils/remove

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Method: remove

Summary

Removes/deletes the specified element(s) from the DOM.

Syntax

<Element/Array> remove(<String/Element/Array> n, <bool> k)

Parameters

n
ID of element or DOM element object or array containing multiple elements/ids.
k
Optional state to keep children or not. If set to true all children will be placed at the location of the removed element.

Returns

HTML DOM element that got removed or array of elements depending on input.

Examples

// Removes all paragraphs in the active editor
tinyMCE.activeEditor.dom.remove(tinyMCE.activeEditor.dom.select('p'));

// Removes a element by id in the document
tinyMCE.DOM.remove('mydiv');
Personal tools