title: Calculate total width of child elements in more than one class using jquery
body: <p>I'm haviing following code</p>
  
  <pre><code> &lt;span class="numbers"&gt;
      &lt;a href="#"&gt;20&lt;/a&gt;, &lt;a href="#"&gt;50&lt;/a&gt;, &lt;a href="#"&gt;100&lt;/a&gt;
   &lt;/span&gt;
  </code></pre>
  
  <p>class "numbers" is position absolute element &amp; its using more than one time in a page. </p>
  
  <p>Content inside class"numbers" will be dynamically changing. So I need to apply total width of children to its parent container</p>
  
  <p>I tried this code but not working.</p>
  
  <pre><code>var totalWidth = 0;
  $(".numbers").children('a').each(function() {
        totalWidth = totalWidth + $(this).width();
        $('.numbers').each(function(){$(this).css("width", totalWidth);});
  });
  </code></pre>
  
  <p>But I'm getting totalWidth value 0 only. Can any one help please..........?</p>
  
  <p>Please see <a href="http://jsfiddle.net/contactsreejesh/xP3mn/6/" rel="nofollow">http://jsfiddle.net/contactsreejesh/xP3mn/6/</a></p>