I\'m working on some ECMAScript/JavaScript for an SVG file and need to get the width and height of a text element so I can resize a re
width
height
text
var bbox = textElement.getBBox(); var width = bbox.width; var height = bbox.height;
and then set the rect's attributes accordingly.
Link: getBBox() in the SVG v1.1 standard.