getBoundingClientRect

The Element.getBoundingClientRect() method returns a position relative to the viewport.

MDN Reference