I have a DocumentFragment stored in \"selectedContents\", and I am trying to find \"span\" elements in it, with the help of jQuery. It has two child nodes, where the first o
Because you're passing a collection of elements, you need to use .filter() to filter the out of the set.
$(selectedContents.childNodes).filter('span');
The .find() method is used to search for descendants.
EDIT: Note that your approach of passing the childNodes into the jQuery object is correct. You can't pass a documentFragment as some suggest.
Here's an example to illustrate: http://jsfiddle.net/P8nur/