aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 3db2c3552..742ec2543 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -77,7 +77,14 @@ jQuery.fn.extend({
wrapInner: function( html ) {
return this.each(function() {
- jQuery( this ).contents().wrapAll( html );
+ var self = jQuery( this ), contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
});
},