So you want to find position of certain object in DOM space.
You search about how to get the top and left position.
You see basically there's a ton (I exagerate this, but you know) of property in HTMLElement, you see clientTop, offsetTop, etc etc...
Which one that you need to use?
So just see this simple web, it's based on this Microsoft site (surprise, Surprise!)
It's abbreviation of BoundingClientRect. You get it by element.getBoundingClientRect()
It's abbreviation of ComputedStyle. You get it by window.getComputedStyle(element, null)