title: jQuery .parent() select multiple levels up
body: <p>I have a hierarchy like this:</p>
  
  <pre><code>&lt;search&gt;
      &lt;inner&gt;
          &lt;input/&gt;
          &lt;p/&gt;
          &lt;img/&gt;
      &lt;/inner&gt;
  &lt;/search&gt;
  </code></pre>
  
  <p>What I am trying to do is to select the parent <code>&lt;search&gt;</code> of the <code>&lt;input/&gt;</code> onFocus, but if I do this:</p>
  
  <pre><code>$(function(){
      $("input").focus(function(){
          console.log($(this).parent("search"));
      });
  });
  </code></pre>
  
  <p>The console shows an empty array. Is there a clean way to select a parent more than one level up? The only way I know of to do this would be <code>.parent().parent("search")</code>, which would work, but is not very clean, and if I were trying to select a parent 5 tiers up, would be just atrocious.</p>