Skip to content
Permalink
Browse files

Make sure that .html(Function) gets the correct previous value.

  • Loading branch information
jeresig committed Jan 7, 2010
1 parent cc1a348 commit 8fa9e9d6d0307a5af8d7478d6e030af5afabba9e
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/manipulation.js
@@ -196,6 +196,14 @@ jQuery.fn.extend({
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 );
}

0 comments on commit 8fa9e9d

Please sign in to comment.
You can’t perform that action at this time.