title: How to get the width of an SVG tspan element
body: <p>I'm trying to get the rendered width of a <code>tspan</code> element (located inside a <code>text</code> element) in SVG.</p>
  
  <p>This is my markup:</p>
  
  <pre><code>&lt;text&gt;
      &lt;tspan&gt;Value 1&lt;/tspan&gt;
      &lt;tspan&gt;Value 2&lt;/tspan&gt;
  &lt;/text&gt;
  </code></pre>
  
  <p>Visually, I want value 1 to float left, while value 2 floats right, so that a multiple elements will align as such:</p>
  
  <pre><code>Value 1                                                                   Value 2
  Value 10                                                                 Value 20
  Value 100                                                               Value 200
  Value 1000                                                             Value 2000
  </code></pre>
  
  <p>Since I want the width of the <code>tpsan</code> ("value 1"/"value 2") and not the text element, I can't use <code>getBBox()</code>, as that method doesn't apply to <code>tspan</code> elements.</p>
  
  <p>Oddly enough, using jQuery's <code>width()</code> method will return the correct value in Chrome, but returns <code>NaN</code> in Firefox. Any ideas would be appreciated.</p>