by Monir Mamoun
an embarrassingly simple, yet extraordinary handy plugin, that combines the filter function (which returns only top level elements matching the selector) and find function (which returns only descendent elements matching the selector) into one handy call. Useful for exfiltrating matching elements when jquery object DOM/nesting structure is unknown or mixed
i searched all over for this kind of function... not sure why it does not exist... it seems very handy if you are manipulating a bunch of jquery objects and don't know their level in the hierarchy. not sure why jquery does not make it more straightforward.