daniel_gabriel
07-03-2006, 03:04 PM
Hi all.
I've been searching for a while, but have not come up with anything useful here, on Google, or other forums. My question is regarding block elements having multiple text child nodes, and handling onClick events in Internet Explorer.
Let's say I have the following HTML:
(snippet)
....
<div id="id1">
Here is some text
<a href="some url" id="id2">Here is some text inside a link</a>
Here is some more text
</div>
....
(snippet)
Is there a way in IE (using javascript) to determine on a mouse click which one of the text nodes ('Here is some text' or 'Here is some more text') has been clicked by the user?
I know Mozilla will consider a text node the target of an event, and IE will not. Is there some variable or object that holds more information about which node was clicked in IE? Or maybe a way to determine which node was clicked based on mouse coordinates?
I know how to do this for regular tag elements, but not for text nodes.
Any help or suggestions will be appreciated.
Thanks in advance,
-Daniel
I've been searching for a while, but have not come up with anything useful here, on Google, or other forums. My question is regarding block elements having multiple text child nodes, and handling onClick events in Internet Explorer.
Let's say I have the following HTML:
(snippet)
....
<div id="id1">
Here is some text
<a href="some url" id="id2">Here is some text inside a link</a>
Here is some more text
</div>
....
(snippet)
Is there a way in IE (using javascript) to determine on a mouse click which one of the text nodes ('Here is some text' or 'Here is some more text') has been clicked by the user?
I know Mozilla will consider a text node the target of an event, and IE will not. Is there some variable or object that holds more information about which node was clicked in IE? Or maybe a way to determine which node was clicked based on mouse coordinates?
I know how to do this for regular tag elements, but not for text nodes.
Any help or suggestions will be appreciated.
Thanks in advance,
-Daniel