I am trying to get the rendered width of the tspan element (located inside the text element) in SVG.
This is my markup:
<text> <tspan>Value 1</tspan> <tspan>Value 2</tspan> </text>
Visually, I want a value of 1 to float to the left, and a value of 2 floats to the right, so that multiple elements will align as such:
Value 1 Value 2 Value 10 Value 20 Value 100 Value 200 Value 1000 Value 2000
Since I want the width of tpsan ("value 1" / "value 2") and not a text element, I cannot use getBBox() since this method does not apply to tspan elements.
Oddly enough, using the jQuery width() method will return the correct value in Chrome, but will return NaN in Firefox. Any ideas would be appreciated.
javascript jquery svg
RussellUresti
source share