0 out of 1 rated this helpful - Rate this topic

elementFromPoint method

[This documentation is preliminary and is subject to change.]

Returns the element for the specified x coordinate and the specified y coordinate.

Syntax

var retval = document.elementFromPoint(x, y);

Standards information

There are no standards that apply here.

Parameters

x [in]

Type: long

A Integer that specifies the X-offset, in pixels.

y [in]

Type: long

A Integer that specifies the Y-offset, in pixels.

Return value

Type: ObjectReturns an element object.

Remarks

Coordinates are supplied in client coordinates. The upper-left corner of the client area is (0,0). For elementFromPoint to exhibit expected behavior, the object or element located at position (x, y) must support and respond to mouse events.

See also

document
Reference
clientX
clientY

 

 

Build date: 2/14/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
overlapping elements
In the case of overlapping elements, elementFromPoint returns the element with the highest z-index.  In layman's terms, that is to say, the element that appears "in front" of other content.