title: Parent(), faster alternative?
body: <p>I am working with a dashboard of divs and each div it has a tree of which the buttons are. Every time I have to know which the id of that div is so I am using parent() alot. </p>
  
  <p>Mostly I am doing <code>$(this).parent().parent().parent()</code> to find the ID of div so I can set variables to it. The app is based on the id's of each div.</p>
  
  <p><strong>Is it consider slow to use parent() up to 3 times but pretty much on every function?</strong></p>
  
  <p>Is there any other alternative?</p>
  
  <p>I am looking for something like benchmarks-style which shows what's faster.</p>
  
  <p>Here is an example of the tree:</p>
  
  <pre><code>&lt;div id="6179827893" class="dashdiv"&gt;
     &lt;div class="buttons"&gt;
       &lt;li&gt;&lt;a href="#" class="btn1"&gt;Button 1&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="#" class="btn2"&gt;Button 2&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="#" class="btn3"&gt;Button 3&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="#" class="btn4"&gt;Button 4&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="#" class="btn5"&gt;Button 5&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="#" class="btn6"&gt;Button 6&lt;/a&gt;&lt;/li&gt;
     &lt;/div&gt;
     &lt;div class="dashcontent"&gt;
  
      ....
  
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>