Make sure we use detach instead of remove in replaceWith. Fixes #5785.
[jquery.git] / src / manipulation.js
index 9ed22ba..f2f6c7d 100644 (file)
@@ -216,7 +216,7 @@ jQuery.fn.extend({
                        return this.each(function() {
                                var next = this.nextSibling, parent = this.parentNode;
 
-                               jQuery(this).remove();
+                               jQuery(this).detach();
 
                                if ( next ) {
                                        jQuery(next).before( value );