diff --git a/src/manipulation.js b/src/manipulation.js index 665e53b61..bc07aef02 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -273,8 +273,8 @@ jQuery.fn.extend({ }); } - if ( this[0] ) { - doc = this[0].ownerDocument; + if ( l ) { + doc = this[ 0 ].ownerDocument; fragment = doc.createDocumentFragment(); jQuery.clean( args, doc, fragment, undefined, this ); first = fragment.firstChild;