The position of (X, Y) means the co-ordinate of an element at the top-left point in a document. X represent the horizontal position and Y represent the vertical position. Use element.getBoundingClientRect() property to get the position of an element.
Example 2: In this example, move the pointer over the document to get the position of an element.
- Kotlin | Retrieve Collection Parts
- Retrieve Single Elements In Kotlin
- HTML | DOM Style position Property
- HTML | DOM Geolocation position Property
- How to change an HTML element name using jQuery ?
- How to set the default value for an HTML <select> element?
- How to convert an HTML element or document into image ?
- How to check an HTML element is empty using jQuery ?
- How to remove parent element except its child element using jQuery ?
- p5.js | position() Function
- How to position a div at specific coordinates ?
- CSS | object-position Property
- How to position a div at the bottom of its container using CSS?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.