Retrieve the position (X,Y) of an HTML element relative to the browser window
Asked 07 September, 2021
Viewed 2.2K times
  • 51
Votes

I want to know how to get the X and Y position of HTML elements such as img and div in JavaScript relative to the browser window.

29 Answer