Replaces the receiver’s current selection with the specified DOM node.
- macOS 10.3+
The node that replaces the current selection. If
NOTDOM error is thrown as an exception. Use the
deletemethod to delete the selection.
If the current selection is collapsed (a range is selected with the same nodes and offsets for the start and end) then no content is removed when inserting the node, and the selection is collapsed and moved to the end of the inserted content. If no content is selected, the node is not inserted.