Range.insertNode( ): insert a node at the start of a range — DOM Level 2 Range
newNode) throws RangeException, DOMException;
The node to be inserted into the document.
This method throws a RangeException with a
newNode is an Attr, Document, Entity, or
This method also throws a DOMException with one of the
code values under the
The node that contains the start of the range does not allow children, it does not allow children of the specified type, or
newNodeis an ancestor of that node.
The node that contains the start of the range or any of its ancestors is read-only.
newNodeis part of a different document than the range is.
This method inserts the specified node (and all its
descendants) into the document at the start position of this range.
When this method returns, this range includes the newly inserted
newNode is already part of the
document, it is removed from its current position and then
reinserted at the start of the range. If
newNode is a DocumentFragment node, it is
not inserted itself, but all of its children are inserted, in order,
at the start of the range.
If the node that contains the start of the range is a Text
node, it is split into two adjacent nodes before the insertion takes
newNode is a Text node, it is not merged with any adjacent ...