PDA

View Full Version : unable 1 function to fire out of 2


frontline
10-31-2002, 07:36 AM
Hello
i have this scenario :
<tr onclick=foo2()>
<td> <img src=blah.jpg onclick=foo2()></td>
</tr>
this is my function call in basic structure ( i have more in to it but its not relevant to this case) and yes its has to be in
this structure that is one function call in the <tr> and one in the <img> inside the <tr>
now my problem is that when i click on the <img> i trigger the <tr> onclick also. and i like to avoid this, i like to be able
when i click the <img> to trigger only the onclick in the <img> and when i click the <tr> to trigger the onclick in the <tr>.
i hope you got my point here.
thanks!

beetle
10-31-2002, 09:10 AM
mebbe this?

<tr onclick="event.cancelBubble=true; foo2();">
<td>
<img src=blah.jpg onclick="event.cancelBubble=true; foo2();">
</td>
</tr>

frontline
10-31-2002, 09:25 AM
Yes this is it!
thanks!