Document.elementFromPoint() (Method)

Determine which element is under a particular x, y location.

Availability:

JScript - 3.0
Internet Explorer - 4.0
Property/method value type:Object object
JavaScript syntax:IEmyDocument.elementFromPoint(xCoordinate, yCoordinate)
Argument list:xCoordinateThe X-coordinate value
yCoordinateThe Y-coordinate value

The result of this method will be a reference to the Element object under the x,y point.

The document is inspected and the browser works out the topmost Element object at the indicated x,y location. That Element object is then returned as the result. This is very much like executing a mouse click at a location in the document window, and then extracting the target Element object from the event object. However this is far simpler.

See also:Document object