There are many article about how to get the user selected text in HTML page. But my question is how to get the corresponding DOM element instead of only text? It might be similar as FireBug, the text node must be a leaf in the DOM tree, how can I get the element?
Thanks