Just like I can get an element from a point with document.elementFromPoint or document.getElementFromPoint, is it possible to somehow get a text node if the point is at a text node? I guess if at least I could get the text node’s position and size I could then figure out which of them contains the point. But then DOM nodes don’t have position properties. Is it possible to do this at all?
Just like I can get an element from a point with document.elementFromPoint or document.getElementFromPoint
Share
Here is an implementation that works in all current browsers:
https://github.com/nuxodin/q1/blob/master/q1.dom.js