title: Which is the better jQuery approach to autofit children on parent DIV width?
body: <p>Based on the answers to another mine question (this: <a href="https://stackoverflow.com/questions/5858108/how-to-make-children-auto-fit-parents-width-only-with-css">How to make children auto fit parent&#39;s width only with CSS?</a>), I'm thinking which is the best jQuery approach to solve the problem regarding performance.</p>
  
  <p><em>Block 1: find all DOM elements when needed:</em></p>
  
  <pre><code>$("div.parent a").css("width", $("div.parent").width() / $("div.parent a").length - 2);
  </code></pre>
  
  <p><em>Block 2: find only DOM children, use each(), parent() and siblings():</em></p>
  
  <pre><code>$("div.parent a").each(function() {
      $(this).css("width", $(this).parent().width() / $(this).siblings().length - 2);
  });
  </code></pre>
  
  <p><em>Block 3: find DOM parent first, use each() and find children based on context:</em></p>
  
  <pre><code>$("div.parent").each(function() {
      $("a", this).css("width", $(this).width() / $("a", this).length - 2);
  });
  </code></pre>
  
  <p>Here is the Fiddle if someone wants to test: <a href="http://jsfiddle.net/ErickPetru/6nSEj/3/" rel="nofollow noreferrer">http://jsfiddle.net/ErickPetru/6nSEj/3/</a></p>
  
  <p><strong>So, which block is better? And why?</strong></p>