this.empty().append( value );
}
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery(this), old = self.html();
+ self.empty().append(function(){
+ return value.call( this, i, old );
+ });
+ });
+
} else {
this.empty().append( value );
}
return this.each(function() {
var next = this.nextSibling, parent = this.parentNode;
- jQuery(this).remove();
+ jQuery(this).detach();
if ( next ) {
jQuery(next).before( value );