aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-09-28 09:50:44 -0700
committerJohn Resig <jeresig@gmail.com>2010-09-28 09:50:44 -0700
commit0368606c081fd15dfbcd8509734ef63c58a6b008 (patch)
tree412253118994987431f9cfcf035fa6a04a244ee3 /src/manipulation.js
parente3c4e5789743eecb3cbe2b626f3a5f09c616ee4b (diff)
downloadjquery-0368606c081fd15dfbcd8509734ef63c58a6b008.tar.gz
jquery-0368606c081fd15dfbcd8509734ef63c58a6b008.zip
Make sure that the contents of the element is still in place when html(Function) is called. Fixes #6733.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js6
1 files changed, 2 insertions, 4 deletions
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 {