Coordinates of selected text in browser page
In IE >= 9 and non-IE browsers (Firefox 4+, WebKit browsers released since early 2009, Opera 11, maybe earlier), you can use the getClientRects() method of Range. In IE 4 – 10, you can use the boundingLeft and boundingTop properties of the TextRange that can be extracted from the selection. Here’s a function that will …