title: How to get bounding box for div element in jQuery
body: <p>I want to calculate bounding box for div element via jQuery/JavaScript.</p>
  <p>I tried like this:</p>
  <pre><code>//Left side of box 
  document.getElementById(&quot;myElement&quot;).offsetLeft; 
  //Top side of box 
  document.getElementById(&quot;myElement&quot;).offsetTop;  
  //Right side of box
  document.getElementById(&quot;myElement&quot;).offsetLeft + document.getElementById(&quot;myElement&quot;).offsetWidth; 
  //Bottom side of box 
  document.getElementById(&quot;myElement&quot;).offsetTop + document.getElementById(&quot;myElement&quot;).offsetHeight; 
  </code></pre>
  <p>It returns some values. whether it is correct way to get bounding box for div element via jQuery / JavaScript.</p>
  <p>I need something like <code>getBBox()</code> method in  <code>SVG</code> element. it will return <code>x</code>, <code>y</code>, <code>width</code> and <code>height</code> of an element. Sameway how can I get bounding box for div element?</p>