To get element at specified position with JavaScript, we use the elementFromPoint
method.
For instance, we write
const elem = document.elementFromPoint(2, 2);
to call document.elementFromPoint
with the coordinate of the element to get to return the element at the coordinates.