I want to get the getBBox() for svg path in jquery. i tried like this
$(\"#\"+ path id)[0].getBBox() -> returns x=0,y=0,width=0,height=0
I too am having a hard time getting the JQuery syntax to work for me. This returned Uncaught TypeError: Object [object Object] has no method 'getBBox':
console.log($("#testtext").getBBox().width);
... because I had omitted the array index (thanks @Christian Vielma, below)!
However standard Javascript worked for me and I was able to display the width of the (in my case) RECT in the Chrome console:
console.log(document.getElementById("testtext").getBBox().width);
So you might try that instead.