title: Is there a way to get the bounding box (in pixels) of a DOM element?
body: <p>Is there a way to get the bounding box coordinates of a DOM element with Javascript?</p>
  
  <p>Obviously I can calculate it from various CSS properties: <code>width</code>, <code>height</code>, and so on. </p>
  
  <p>I’m asking because there are many other graphical platforms that provide this as a method. For instance apparently it can be done in XUL as per <a href="https://stackoverflow.com/questions/3273031/what-is-the-proper-way-to-get-bounding-box-for-html-elements-relative-to-the-win">this post</a>, which describes a method <code>getBoundingClientRect()</code>. </p>
  
  <p>(My goal is to check whether two elements overlap.)</p>