I have obtained the currently selected content in a web page, using Javascript.
For example sample HTML for a web page is given below--
<div id="divText">Text 1
<div id="divText1_1">Text 1_1</div>
<div id="divText1_2">Text 1_2</div>
</div>
Now, the user has selected text "Text 1_2" - from the HTML above, we can see that this is the second div within the div named "divText"- how do I get this information using Js code? The info that I want- "divText1_2" is the second div within its parent HTML element. ( I want to know the number of divs that occurred before "divText1_2"- when text within "divText1_2" has been selected by the user)...