jQuery select child element by class with unknown path

class, css-selectors, html, jquery, selector

Solution

According to this documentation, the find method will search down through the tree of elements until it finds the element in the selector parameters. So `$(parentSelector).find(childSelector)` is the fastest and most efficient way to do this.

Problem

I am trying to figure out the syntax for selecting a nth-child of an element by its class, however I don't know the exact path to the element. I can't do `$('parent > child > grandchild > hereIam');` So basically I need to be able to say ``` $('#thisElement').AllRelativesWithClass('.classToSelect') ``` How exactly do I do that?

Original source