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.
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.