jQuery A problem while finding a child element
<p>Hi I have that html snippet</p>

<pre><code>&lt;span class="container"&gt;
    &lt;span class="inner"&gt;
       &lt;span class="img_class"&gt;
           &lt;img id=img1" /&gt;
       &lt;/span&gt;
       &lt;span class="strip"&gt;&lt;/span&gt;
       &lt;span class="abc_class"&gt;&lt;/span&gt;
    &lt;/span&gt;
&lt;/span&gt;
</code></pre>

<p>when user clicks at the <code>&lt;span class="abc_class"&gt;&lt;/span&gt;</code>, I want to get the <code>closest</code> <code>&lt;span class="img_class"&gt;</code> and then its <code>&lt;img /.&gt;</code>'s ID</p>

<p>To do so, I try</p>

<pre><code>var myId = jQuery($(this).closest('.img_class')).find("img").attr("id");
</code></pre>

<p>where <code>$(this)</code> is that clicked  <code>&lt;span class="abc_class"&gt;</code></p>

<p>The <code>myId</code> is undefined. Why ?</p>
