To record
var a = $('.listItem',$('#myList'));
will execute exactly the same as:
var a = $('#myList').find('.listItem');
In my tests, this works faster :
var a = $('#myList > .listItem');
Oh and:
var a = $('.listItem', '#myList');
wrong . (edit) matches the first example.
EDIT:
I am an idiot. The last example is exactly the same as in the first example in terms of functionality . As for speed, I canβt say. My wild guess was that since in the first example the jQuery object already has the elements requested by the selector, it will be a little faster than the last example, which would still have to find the elements.
source share