I am currently working with an svg element in JavaScript. And I am new to this.
svg
My question is that I have an svg element in which I have m
Try .getBoundingClientRect
.getBoundingClientRect
$('.my-class')[0].getBoundingClientRect().width;
Demo http://jsfiddle.net/5DA45/
I'd recommend getBBox (which is part of SVG 1.1) over getBoundingClientRect (which isn't):
getBBox
getBoundingClientRect
$('.my-class')[0].getBBox().width;
Demo http://jsfiddle.net/TAck4/