The Element.getBoundingClientRect() method returns a DOMRect object providing information about the size of an element and its position relative to the viewport.
Element.getBoundingClientRect()
external DOMRect getBoundingClientRect();