Hello,
I am new to javascript.
I want to be able to do the following if possible:
1) Use the mouse to highlight a section of text on a page.
2) Obtain references (via javascript) to the node(s) that contain the
highlighted text.
3) Manipulate the html of these node(s).
I understand there is a method document.getSelection() that returns
the highlighted text. However, I am unable to obtain the container
node(s) of the text. I have also found the javascript Range API, but
I am unsure how I can interface the highlighted text from
document.getSelection() with the Range API.
Does anyone have any advice or suggestions on how to accomplish this?
Thanks,
Ralph