You do this without spaces, for example:
jQuery('.haystack.needle')
Alternative option:
jQuery('.haystack').filter('.needle')
With the space in which he searches for children from these .haystack elements with .needle , without space you map the same elements, but saying that they must have both classes to match. It also means .filter() , it also reduces the matches set for these elements, also corresponding to the selector that you pass to it.
source share