.filter() vs. .find() on detached elements
I have detached a set of elements and am trying to unhide them. I could swear the selector/context version has been working but suddenly stopped. Now only the .filter() version works.
- var $currentSchedule = _$classSchedules.children().detach();
-
- //Unhide any elements that were hidden by filters
- $(".filter-hidden", $currentSchedule).show().removeClass("filter-hidden"); //Does not work
- $currentSchedule.filter(".filter-hidden").show().removeClass("filter-hidden"); //Works
I've read someone explaining that .find() (which the selector/context version uses) only works on DOM elements, but the documentation for .find() and .filter() both say they work on DOM elements. Is this the expected behavior? How can I tell which methods are supported for detached elements?