I want to ask question is it something possible with text range or other approach. I have a text. For example like this:
<div id="test">abcdefghij</div>
I use text range to highlight fragment of text with yellow color. (I use example posted into SO). It is possible to add event listener for mouser over on highlighted text? I want to do something when user mouseover on 'cdefg'. Here is working jsfiddle.
http://jsfiddle.net/8mdX4/673/
I would appreciate any ideas and recommendations.
Best regards.
Edit:
I want to share the approach that I have usied after the topic. I'm using focusNode property of selection because commonAncestorContainer get container of all nodes - not that node currently selected. Here is demo: http://jsfiddle.net/zono/Q3ptC/2/ Mouseover on yellow text displaing tooltip (content of title property).