Created
January 3, 2011 20:05
-
-
Save chicagoworks/763875 to your computer and use it in GitHub Desktop.
jquery.offspring.js: perform the same duty as children but includes free floating 'text' nodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//perform the same duty as children but includes free floating 'text' nodes | |
jQuery.fn.extend({ | |
offspring: function() { | |
return jQuery( | |
jQuery.map( this, function(n){ | |
return jQuery.grep(n.childNodes, function(n) { | |
return n.nodeType == 1 || n.nodeType == 3; | |
}); | |
}) | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment