How to retrieve the URL of the container parent using jQuery?
<p>I have this:</p>

<pre><code>$(this).find('a:first');
</code></pre>

<p>and is working just fine to retrieve the URL of the first link, if the button I click is into the same container as the link I want to retrieve.</p>

<p>But how to retrieve the URL of the parent container? </p>

<p>In the bellow case, I want to retrieve the link of the a.sharedLink of the same <code>&lt;li&gt;</code> the buttons are in. So if someone is clicking on one of those buttons, onclick event will capture the URL of the a.sharedLink. I have all the entire functionality, all I want is just to get that URL.</p>

<p>e.g:</p>

<pre><code>&lt;ul class="links"&gt;
&lt;li&gt;&lt;a class="sharedLink" href="http://www.domain1.com"&gt;Check out my hilarious personal website! :)&lt;/a&gt;
&lt;span class="buttons"&gt;
    &lt;a href="" class="share shareTW" target="_blank"&gt;Share on Twitter&lt;/a&gt;
    &lt;a href="" class="share shareFB" target="_blank"&gt;Share on Facebook&lt;/a&gt;
    &lt;a href="" class="share shareLI" target="_blank"&gt;Share on LinkedIn&lt;/a&gt;
    &lt;a href="" class="share shareDE" target="_blank"&gt;Share on Delicious&lt;/a&gt;
    &lt;a href="" class="share eMail" target="_blank"&gt;Send by E-Mail&lt;/a&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="sharedLink" href="http://www.domain2.com"&gt;This is my Tech Blog&lt;/a&gt;
&lt;span class="buttons"&gt;
    &lt;a href="" class="share shareTW" target="_blank"&gt;Share on Twitter&lt;/a&gt;
    &lt;a href="" class="share shareFB" target="_blank"&gt;Share on Facebook&lt;/a&gt;
    &lt;a href="" class="share shareLI" target="_blank"&gt;Share on LinkedIn&lt;/a&gt;
    &lt;a href="" class="share shareDE" target="_blank"&gt;Share on Delicious&lt;/a&gt;
    &lt;a href="" class="share eMail" target="_blank"&gt;Send by E-Mail&lt;/a&gt;
&lt;/span&gt;&lt;/li&gt; 
&lt;/ul&gt;
</code></pre>
