getElementFromPoint(x,y) - whaaaat?

Bar*_*der 4 javascript jquery

我之前肯定使用过这段代码,但这次它会抛出一个错误.

我的代码:

$(document).click(function (e) {
  var getPoint = document.getElementFromPoint(e.pageX,e.pageY);
  alert(getPoint);
});
Run Code Online (Sandbox Code Playgroud)

我得到以下错误:

document.getElementFromPoint is not a function
Run Code Online (Sandbox Code Playgroud)

tau*_*oge 8

在Firefox中,这个函数叫做document.elementFromPoint()

https://developer.mozilla.org/En/DOM:document.elementFromPoint