I have a selection, like:
const sel = document.getSelection();
that spans one or more HTML elements, or parts of them.
Can’t find a method to get references to those elements.
The closest thing I found was:
sel.anchorNode.cloneNode()
that returns the node’s text, and what I want is a reference to the HTML node in the DOM.
Is it possible? 🙂