I have two divs as shown below:
<div id="div1">
<p>something</p>
<div><table><tr><td>Div1</td></tr></table></div>
</div>
<div id="div2">
<p>something else</p>
<div><table><tr><td>Div2</td></tr></table></div>
</div>
<button type="button">Check</button>
Now, I want to know when some text is selected and then the button pressed, if the selected text is under "div1" or not. How can I do that?
Edit: And the solution has to work in IE-7 and above.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…