Name

elementFromPoint( ) — NN n/a IE 4 DOM n/a

Synopsis

elementFromPoint(x, y)

Returns a reference to the object directly underneath the pixel coordinates specified by the x (horizontal) and y (vertical) parameters. For an element to be recognized, it must be capable of responding to mouse events. Also, if more than one element is positioned in the same location, the element with the highest zIndex value or, given equal zIndex values, the element that comes last in the source code order is the one returned.

Returned Value

Element object reference.

Parameters

x

Horizontal pixel measure relative to the left edge of the window or frame.

y

Vertical pixel measure relative to the top edge of the window or frame.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.