Make sure that the contents of the element is still in place when html(Function) is called. Fixes #6733.

This commit is contained in:
John Resig 2010-09-28 09:50:44 -07:00
parent e3c4e57897
commit 0368606c08
2 changed files with 13 additions and 4 deletions

View file

@ -248,10 +248,8 @@ jQuery.fn.extend({
} 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 );
});
var self = jQuery(this);
self.html( value.call(this, i, self.html()) );
});
} else {