It:
$('.someChildren', $('#someParent'))
just converts to this:
$('#someParent').find('.someChildren')
after doing some tests. Thus, the actual review will be between:
$('#someParent .someChildren')
and
$('#someParent').find('.someChildren')
(taking into account the work of analysis and transformation).
So which of these two is faster is probably browser dependent. I personally never use the context parameter.
If you want .find() , I would just use it directly, instead of jQuery flipping it for you.
People often use context when it is necessary to set this as the root of .find() .
$('.someChildren', this)
... so in this case itβs faster to do this:
$(this).find('.someChildren')
... and more understandable in my opinion.
source share