Fixed wrapping of elements that hold text nodes. Thanks to David Flanagan for the patch. Fixes #4902.

This commit is contained in:
John Resig 2009-07-14 23:28:07 +00:00
parent ad5ba1a72e
commit 991dafae16
2 changed files with 7 additions and 2 deletions

View file

@ -32,7 +32,7 @@ jQuery.fn.extend({
wrap.map(function(){
var elem = this;
while ( elem.firstChild )
while ( elem.firstChild && elem.firstChild.nodeType === 1 )
elem = elem.firstChild;
return elem;