title: ID from parents parent adjacent element
body: <p>I need to get the ID of the "parents parent adjacent" element. I've come so far that I can select the element that contains the ID. Now I just need to output the ID.</p>
  
  <hr>
  
  <p><strong><a href="http://jsfiddle.net/Alex_Gr/ztuttzuL/2/" rel="nofollow">JSFiddle</a></strong></p>
  
  <p>jQuery:</p>
  
  <pre><code>$(function(){
      var a = $('.function').closest('li').find('a:first').attr('id');
      console.log(a);
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;
          &lt;a id="get-this-ID-1"&gt;
              Link 1.
          &lt;/a&gt;
          &lt;div&gt;
              &lt;div class="function"&gt;
                  Function 1 here.
              &lt;/div&gt;
              &lt;a&gt;Link2 1.&lt;/a&gt;
          &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a id="get-this-ID-2"&gt;
              Link 2.
          &lt;/a&gt;
          &lt;div&gt;
              &lt;div class="function"&gt;
                  Function 2 here.
              &lt;/div&gt;
              &lt;a&gt;Link2 2.&lt;/a&gt;
          &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a id="get-this-ID-3"&gt;
              Link 3.
          &lt;/a&gt;
          &lt;div&gt;
              &lt;div class="function"&gt;
                  Function 3 here.
              &lt;/div&gt;
              &lt;a&gt;Link2 3.&lt;/a&gt;
          &lt;/div&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>