Commit 8fa9e9d6 authored by jeresig's avatar jeresig

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

parent cc1a3485
......@@ -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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment