SCEditor

insertNode()

insertNode(startNode[, endNode]) Since: 1.3.5

Inserts a DOM node at the position of the current selection.

See the insertHTML() method for the HTML equivalent.

Info: Using the sceditor.insert() method is the preferred way of inserting HTML into the editor as it checks if the editor is in WYSIWYG or source mode and insert it into the appropriate place.

Warning!

The DOM nodes must belong to the document they are being inserted in. If they belong to another document, an error will be thrown.

Syntax

instance.insertNode(startNode[, endNode]);

Parameters

start
Type: Node

The DOM node to insert.

end
Type: Node Default: null

If specified and there is any text selected, the selected text will be placed between the start and end nodes.