Is there any way to get the text, which lies between two given graphical points on the current page using Javascript?
Say, it is given two points p1=(x1,y1)
and p2=(x2, y2)
.
How can I get the text which lies between p1
and p2
on the current HTML/web page?
My requirement is: When we mousedown
on a page and move the mouse, it selects the underlying texts. I want to select and get the texts, without actually moving the mouse, but just passing two points.
In other words, I want to fake getSelection()
with two points.