jquery $(this).prev(".class") not working <p>Given this simple setup</p> <pre><code>&lt;div class="parent"&gt; &lt;div class="child"&gt;I'm spoiled&lt;/div&gt; &lt;/div&gt; &lt;div class="aunt"&gt;&lt;/div&gt; &lt;div class="uncle"&gt;&lt;/div&gt; &lt;div class="parent"&gt; &lt;div class="child"&gt;I'm spoiled&lt;/div&gt; &lt;/div&gt; &lt;div class="aunt"&gt;&lt;/div&gt; &lt;div class="uncle"&gt;&lt;/div&gt; </code></pre> <p>When I detect a click on class "uncle", I want to get the sibling of the closest previous ".parent". I should be able to do</p> <pre><code>$( this ).prev( ".parent" ).children( ".child" ).text(); </code></pre> <p>...but this returns a blank. </p> <p>If I do</p> <pre><code>$( this ).prev().prev().children( ".child" ).text(); </code></pre> <p>...this returns the expected result: "I'm spoiled"</p> <p>Is there some limitations to the use of prev( [selector] ) I'm missing?</p> <p>[UPDATE]</p> <p>.prevAll() returns all previuos classes, so the result of </p> <pre><code>$( this ).prevAll( ".parent" ).children( ".child" ).text(); </code></pre> <p>Is "I'm spoiledI'm spoiled" if I click on the second ".uncle", which is not the result I want.</p> <p>I just need the immediate closest previous one.</p>