DocumentOrShadowRoot.elementsFromPoint()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
elementsFromPoint()
是 DocumentOrShadowRoot
下的一个函数,该函数返还在特定坐标点下的 HTML 元素数组。
语法
var elements = document.elementsFromPoint(x, y);
参数
返回值
一个包含 element
对象的数组。
规范
Specification |
---|
CSSOM View Module # dom-document-elementsfrompoint |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
elementsFromPoint |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
- Requires a vendor prefix or different name for use.
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.