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 |
浏览器兼容性
BCD tables only load in the browser