From 0368606c081fd15dfbcd8509734ef63c58a6b008 Mon Sep 17 00:00:00 2001 From: John Resig Date: Tue, 28 Sep 2010 09:50:44 -0700 Subject: Make sure that the contents of the element is still in place when html(Function) is called. Fixes #6733. --- src/manipulation.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/manipulation.js b/src/manipulation.js index 00e31201c..325f303a8 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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 { -- cgit v1.2.3