🆕 Document.caretPositionFromPoint() is Newly Available!

Give it an (x, y) coordinate and get back the exact DOM node and character offset. Perfect for click-to-edit interfaces.

Check it out 👇
https://developer.mozilla.org/en-US/docs/Web/API/Document/caretPositionFromPoint