title: How do I calculate the width between two elements?
body: <p>I need to calculate the width between two elements but I'm not sure how I would go about this. Say I have the following:</p>
  
  <pre><code>&lt;ul id="foo"&gt;
      &lt;li style="width:10px;"&gt;&lt;a href="#"&gt;1&lt;/a&gt;&lt;/li&gt;
      &lt;li style="width:20px;"&gt;&lt;a href="#"&gt;2&lt;/a&gt;&lt;/li&gt;
      &lt;li style="width:30px;"&gt;&lt;a href="#"&gt;3&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>How would I calculate the distance between 1 and 3 (answer being 20px)? The width can be variable as can the number of list items? (I'm using the Prototype framework)</p>
  
  <p>Thanks</p>