Element Methods: getBoundingClientRect()
getBoundingClientRect() method of the
Element object and takes no arguments. It returns an object with the
bottom (and usually
height) properties which hold the
Element object's viewport coordinates. The
left properties hold the element's position from its top-left corner, while the
right properties hold its position from the bottom-right corner.
The coordinates returned by this method include the border and padding of the element, but not its margins.