tinymce.html.js
function(node) {
                var self = this;
                node.parent && node.remove();
                self.insert(node, self);
                self.remove();
                return self;
            }
function(node) {
                var self = this;
                node.parent && node.remove();
                self.insert(node, self);
                self.remove();
                return self;
            }
function ( node ) { var self = this ; node . parent && node . remove ( ) ; self . insert ( node , self ) ; self . remove ( ) ; return self ; }
Replaces the current node with the specified one.

@example
someNode.replace(someNewNode);

@method replace
@param {tinymce.html.Node} node Node to replace the current node with.
@return {tinymce.html.Node} The old node that got replaced.
Replaces the current node with the specified one .