How do I get the value of a parent LI from the click of a child link?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7765931/getting-a-parent-element-for-a-jquery-selector">Getting a parent element for a jquery selector</a>  </p>
</blockquote>



<p>I have a list of item :</p>

<pre><code>        &lt;div id="wrap"&gt;&lt;ul class="thumbs noscript"&gt;
        &lt;li id="1"&gt;
        &lt;a class="thumb" href="photos/10-01.jpg" title="" /&gt;
        &lt;img src="photos/10-01_thumb.jpg" alt="" /&gt;
        &lt;/a&gt;
        &lt;div class="caption"&gt;
        &lt;div class="download"&gt;&lt;a href="#" class="add2cart"&gt;Save Image&lt;/a&gt;&lt;/div&gt;
        &lt;div class="image-title"&gt;Titre de la photo #1&lt;/div&gt;
        &lt;div class="image-desc"&gt;Description de la photo #1&lt;/div&gt;
        &lt;/div&gt;
        &lt;/li&gt; /* and so on with li's and different ID's... */
</code></pre>

<p>I can't get the value of the li ID, therefore, the title.
Have read and tried almost every answer on here, they won't work once I test on my site...
Any idea ? TY folks</p>

<pre><code>$(document).ready(function(){
    $("#wrap &gt; ul &gt; li &gt; .caption &gt; .download &gt; .add2cart").click(function(){
        var thisID = $(this).closest('li').attr("id");
        alert(thisID);
    });
});
</code></pre>

<p>RIGHT ANSWER (see below) : insomiac, tyvm
And thanks also to  Diodeus for pointing out ID problem.
Thanks to all the folks who answered ;)</p>
