Find an Element’s Position Using Javascript
I went through quite a few Google searches trying to figure this out. My problem was that I needed to get the coordinate of a touch event relative to the top left corner of an element. However, the TouchEvent object doesn’t have the offsetX or offsetY, which, in contrast, the MouseEvent …