Internet Explorer textNode events
You people have been very helpful so far. The discussions we've had on here brought around more innovative ideas and new challenges (which is good). One of those is:
I am looking for a way to assign a click handler to a document (in Internet Explorer) in such a way that I would be able to distinguish what text node was clicked by the user if a parent element contains more than 1.
Example:
<div id="id2">
text1
<a href="some url">text2</a>
text3
</div>
Keeping in mind that I have no control over HTML (it will be provided by the user), I need to come up with a JavaScript function that will handle a user click. In the case above, Internet Explorer will consider the div to be the source of the click event, so there is no way to find out whether text1 or text3 was clicked.
Is there some IE object/method/function/property that I am not aware of that can perfom such a task? I cannot wrap any text in tags (like span) because I can't touch the HTML.
Thanks for advice,
-Daniel
I am looking for a way to assign a click handler to a document (in Internet Explorer) in such a way that I would be able to distinguish what text node was clicked by the user if a parent element contains more than 1.
Example:
<div id="id2">
text1
<a href="some url">text2</a>
text3
</div>
Keeping in mind that I have no control over HTML (it will be provided by the user), I need to come up with a JavaScript function that will handle a user click. In the case above, Internet Explorer will consider the div to be the source of the click event, so there is no way to find out whether text1 or text3 was clicked.
Is there some IE object/method/function/property that I am not aware of that can perfom such a task? I cannot wrap any text in tags (like span) because I can't touch the HTML.
Thanks for advice,
-Daniel
