range-at-xy
Given an HTMLElement
and a pair of coordinates x
and y
, returns a Range
object, containing the text character visible at position (x, y)
.
If no character is visible at position (x, y)
, null
is returned.
Important: Coordinates must be provided on the viewport coordinate system. (i.e. e.clientX
and e.clientY
)
example
var atxy = ; documentbody