title: Get bounding box for SVG path using jQuery
body: <p>I want to get the getBBox() for svg path in jquery. i tried like this</p>
  
  <pre><code>$("#"+ path id)[0].getBBox() -&gt; returns x=0,y=0,width=0,height=0
  </code></pre>
  
  <p>I have added the path to an SVG element. I tried some other element in SVG, for example text node in that case it returns the some bounding box value.</p>
  
  <p>How can I calculate the bounding box for a path in SVG?</p>
  
  <pre><code>&lt;path id="container_svg_John_0" fill="none" stroke-width="3" stroke="url(#container_svg_John0Gradient)" stroke-linecap="butt" stroke-linejoin="round" d="M -2390.2 -125.8888888888889 L 0 0 M 0 0 L 251.60000000000002 -45.77777777777778 M 251.60000000000002 -45.77777777777778 L 503.20000000000005 -11.444444444444445 M 503.20000000000005 -11.444444444444445 L 629 -183.11111111111111 "/&gt;
  </code></pre>