your example could be improved by offering a context example as well.
const myElement = $('.foo', context);
or
const myElement = $context.find('.foo');
and the same 'non jQuery' solutions but replace document with context (or is rootElement maybe a better label?).
I think this is a common enough use case and I see a lot of people searching the entire DOM when they do have a context to start with. Just a suggestion.
in your Querying the DOM section https://github.com/ndugger/youdontneedjquery#querying-the-dom
your example could be improved by offering a context example as well.
const myElement = $('.foo', context);
orconst myElement = $context.find('.foo');
and the same 'non jQuery' solutions but replace
document
withcontext
(or is rootElement maybe a better label?).I think this is a common enough use case and I see a lot of people searching the entire DOM when they do have a context to start with. Just a suggestion.