document.elementFromPoint() and document.elementsFromPoint()
Widely available
The document.elementFromPoint()
and document.elementsFromPoint()
methods find the top-most element at a given point in the viewport, or all elements at a given point in the viewport, respectively.
To learn more, see
Document: elementFromPoint() method,
Document: elementsFromPoint() method at MDN.
Compatibility (view on caniuse.com)
- Chrome 43 Released on 2015-05-19
- Chrome Android 43 Released on 2015-05-27
- Edge 79 Released on 2020-01-15
- Firefox 46 Released on 2016-04-26
- Firefox for Android 46 Released on 2016-04-26
- Safari 11.1 Released on 2018-04-12
- Safari on iOS 11.3 Released on 2018-03-29