GetElementFromPoint (x, y) - whaaaat?

I have definitely used this code before, but this time it causes an error.

My code is:

$(document).click(function (e) { var getPoint = document.getElementFromPoint(e.pageX,e.pageY); alert(getPoint); }); 

And I get the following Error :

 document.getElementFromPoint is not a function 
+4
source share
2 answers

In Firefox, this function is called document.elementFromPoint ()

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

+8
source

I changed the: getElementFromPoint method to: elementFromPoint and it works fine in IE8 and the latest Firefox.

+2
source

All Articles