It sets this
as the context from which the query is performed.
An equivalent (and slightly more efficient) way to write it is:
return $(this).find('strong').length == 2;
When I say equivalent, I mean behind the scenes, it is actually flipped around into the version above.
If you remove the 'strong'
, you won't have a valid selector. You'll be doing:
return $(this).find('').length == 2;
Looks like it just returns an empty jQuery object, which means length
will be 0
, so you won't get any elements out of the .filter()
.
Reference:
http://api.jquery.com/jQuery/
jQuery( selector [, context ] )
context
Type: Element or jQuery
A DOM Element, Document, or jQuery to use as context